|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.persist.impl.VisitedObjects
class VisitedObjects
Keeps track of a set of visited objects and their corresponding offset in a byte array. This uses a resizable int array for speed and simplicity. If in the future the array resizing or linear search are performance issues, we could try using an IdentityHashMap instead.
Field Summary | |
---|---|
(package private) static int |
PRI_KEY_VISITED_OFFSET
|
(package private) static String |
PROHIBIT_NESTED_REF_MSG
|
(package private) static Object |
PROHIBIT_REF_OBJECT
|
(package private) static int |
PROHIBIT_REF_OFFSET
|
Constructor Summary | |
---|---|
VisitedObjects()
Creates an empty set. |
Method Summary | |
---|---|
(package private) int |
add(Object o,
int offset)
Adds a visited object and offset, growing the visited arrays as needed. |
(package private) Object |
getObject(int offset)
Returns the visited object for a given offset, or null if never visited. |
(package private) int |
getOffset(Object o)
Returns the offset for a visited object, or -1 if never visited. |
(package private) void |
replaceObject(Object existing,
Object replacement)
Replaces a given object in the list. |
(package private) void |
setObject(int index,
Object o)
Sets the object for an existing slot index. |
(package private) void |
setOffset(int index,
int offset)
Sets the offset for an existing slot index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int PRI_KEY_VISITED_OFFSET
static final int PROHIBIT_REF_OFFSET
static final Object PROHIBIT_REF_OBJECT
static final String PROHIBIT_NESTED_REF_MSG
Constructor Detail |
---|
VisitedObjects()
Method Detail |
---|
int add(Object o, int offset)
void setObject(int index, Object o)
void setOffset(int index, int offset)
int getOffset(Object o)
Object getObject(int offset)
void replaceObject(Object existing, Object replacement)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |