public class ObjectIdMap extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ObjectIdMap.Entry
A simple list structure to store a registered object and its ID.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
INT_MAP_CAPACITY |
| Constructor and Description |
|---|
ObjectIdMap(int initialCapacity,
File outputDir)
Create an instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
capacity() |
void |
close() |
long |
getId(Object o)
Translate an object into an ID.
|
protected void |
onNewObject(Object o)
A placeholder for handling a new object.
|
protected void |
onNewObjectId(Object o,
long id)
A placeholder for handling a new object.
|
int |
size() |
public static final int INT_MAP_CAPACITY
public ObjectIdMap(int initialCapacity,
File outputDir)
throws IOException
initialCapacity - is the size of an internal array to manage the contents.outputDir - location to save the object map, optionalIOExceptionpublic long getId(Object o)
o - is an object used in the logging target program.protected void onNewObject(Object o)
o - is the object passed to the getId method.protected void onNewObjectId(Object o, long id)
o - is the object passed to the getId method.id - is the ID assigned to the object.public int size()
public int capacity()
public void close()
Copyright © 2023. All rights reserved.