| java.lang.Object com.sleepycat.persist.impl.VisitedObjects
VisitedObjects | class VisitedObjects (Code) | | 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.
author: Mark Hayes |
Method Summary | |
int | add(Object o, int offset) Adds a visited object and offset, growing the visited arrays as needed. | Object | getObject(int offset) Returns the visited object for a given offset, or null if never visited. | int | getOffset(Object o) Returns the offset for a visited object, or -1 if never visited. | void | replaceObject(Object existing, Object replacement) Replaces a given object in the list. | void | setObject(int index, Object o) Sets the object for an existing slot index. | void | setOffset(int index, int offset) Sets the offset for an existing slot index. |
PRI_KEY_VISITED_OFFSET | final static int PRI_KEY_VISITED_OFFSET(Code) | | |
PROHIBIT_NESTED_REF_MSG | final static String PROHIBIT_NESTED_REF_MSG(Code) | | |
PROHIBIT_REF_OBJECT | final static Object PROHIBIT_REF_OBJECT(Code) | | |
PROHIBIT_REF_OFFSET | final static int PROHIBIT_REF_OFFSET(Code) | | |
VisitedObjects | VisitedObjects()(Code) | | Creates an empty set.
|
add | int add(Object o, int offset)(Code) | | Adds a visited object and offset, growing the visited arrays as needed.
the index of the new slot. |
getObject | Object getObject(int offset)(Code) | | Returns the visited object for a given offset, or null if never visited.
|
getOffset | int getOffset(Object o)(Code) | | Returns the offset for a visited object, or -1 if never visited.
|
replaceObject | void replaceObject(Object existing, Object replacement)(Code) | | Replaces a given object in the list. Used when an object is converted
after adding it to the list.
|
setObject | void setObject(int index, Object o)(Code) | | Sets the object for an existing slot index.
|
setOffset | void setOffset(int index, int offset)(Code) | | Sets the offset for an existing slot index.
|
|
|