com.sleepycat.persist.impl
Class VisitedObjects

java.lang.Object
  extended by com.sleepycat.persist.impl.VisitedObjects

 class VisitedObjects
extends java.lang.Object

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

Constructor Summary
VisitedObjects()
          Creates an empty set.
 
Method Summary
(package private)  void add(java.lang.Object o, int offset)
          Adds a visited object and offset, growing the visited arrays as needed.
(package private)  java.lang.Object getObject(int offset)
          Returns the visited object for a given offset, or null if never visited.
(package private)  int getOffset(java.lang.Object o)
          Returns the offset for a visited object, or -1 if never visited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisitedObjects

VisitedObjects()
Creates an empty set.

Method Detail

add

void add(java.lang.Object o,
         int offset)
Adds a visited object and offset, growing the visited arrays as needed.


getOffset

int getOffset(java.lang.Object o)
Returns the offset for a visited object, or -1 if never visited.


getObject

java.lang.Object getObject(int offset)
Returns the visited object for a given offset, or null if never visited.



Copyright 2004-2006 Sleepycat, Inc. All Rights Reserved.