public class ObjectIdFile extends ObjectIdMap
ObjectIdMap.Entry| Modifier and Type | Field and Description |
|---|---|
static long |
cacheHit |
static long |
cacheMiss |
static long |
ID_NOT_FOUND |
INT_MAP_CAPACITY| Constructor and Description |
|---|
ObjectIdFile(File outputDir,
boolean recordString,
TypeIdMap typeToId)
Create an instance to record object types.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the files written by this object.
|
protected void |
onNewObject(Object o)
Register a type for each new object.
|
protected void |
onNewObjectId(Object o,
long id)
Record an object ID and its Type ID in a file.
|
capacity, getId, sizepublic static final long ID_NOT_FOUND
public static long cacheHit
public static long cacheMiss
public ObjectIdFile(File outputDir, boolean recordString, TypeIdMap typeToId) throws IOException
outputDir - is a directory for output files.recordString - is a flag to recording string contents.
If the flag is true, this object records the contents of String objects in files.typeToId - is an object to translate a type into an integer representing a type.IOException - failed to save object id fileprotected void onNewObject(Object o)
onNewObject in class ObjectIdMapo - is the object passed to the getId method.protected void onNewObjectId(Object o, long id)
onNewObjectId in class ObjectIdMapo - is the object passed to the getId method.id - is the ID assigned to the object.public void close()
close in class ObjectIdMapCopyright © 2023. All rights reserved.