public class IdPreMap
extends java.lang.Object
| Constructor and Description |
|---|
IdPreMap(int id)
Constructor.
|
IdPreMap(IOFile f)
Construct a map by reading it from a file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(int pre,
int id,
int c)
Delete records.
|
void |
insert(int pre,
int id,
int c)
Insert new record.
|
int |
pre(int id)
Find the PRE value of a given ID.
|
int[] |
pre(int[] ids,
int off,
int len)
Find the PRE values of a given list of IDs.
|
java.lang.String |
toString() |
void |
write(IOFile f)
Write the map to the specified file.
|
public IdPreMap(int id)
id - last inserted IDpublic IdPreMap(IOFile f) throws java.io.IOException
f - file to read fromjava.io.IOException - I/O error while reading from the filepublic void write(IOFile f) throws java.io.IOException
f - file to write tojava.io.IOException - I/O error while writing to the filepublic int pre(int id)
id - IDpublic int[] pre(int[] ids,
int off,
int len)
ids - IDsoff - start position in ids (inclusive)len - number of idspublic void insert(int pre,
int id,
int c)
pre - record PREid - record IDc - number of inserted recordspublic void delete(int pre,
int id,
int c)
pre - PRE of the first recordid - ID of the first deleted recordc - number of deleted recordspublic java.lang.String toString()
toString in class java.lang.Object