Package org.basex.index
Class IdPreMap
java.lang.Object
org.basex.index.IdPreMap
Updatable ID-PRE mapping.
- Author:
- BaseX Team 2005-21, BSD License, Dimitar Popov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(int pre, int id, int c) Deletes records.final voidfinish(int base) Finishes database creation.voidinsert(int pre, int id, int c) Inserts a new record.intpre(int id) Finds the PRE value of a given ID.intsize()Returns the size of the map.toString()final voidWrite the map to the specified file.
-
Constructor Details
-
IdPreMap
public IdPreMap(int id) Constructor.- Parameters:
id- last inserted ID
-
IdPreMap
Constructs a map by reading it from a file.- Parameters:
f- file to read from- Throws:
IOException- I/O error while reading from the file
-
-
Method Details
-
write
Write the map to the specified file.- Parameters:
file- file to write to- Throws:
IOException- I/O error while writing to the file
-
finish
public final void finish(int base) Finishes database creation.- Parameters:
base- last id
-
pre
public int pre(int id) Finds the PRE value of a given ID.- Parameters:
id- ID- Returns:
- PRE or -1 if the ID is already deleted
-
insert
public void insert(int pre, int id, int c) Inserts a new record.- Parameters:
pre- record PREid- record IDc- number of inserted records
-
delete
public void delete(int pre, int id, int c) Deletes records.- Parameters:
pre- PRE of the first recordid- ID of the first deleted recordc- number of deleted records (negative)
-
size
public int size()Returns the size of the map.- Returns:
- number of stored tuples
-
toString
-