All Packages Class Hierarchy This Package Previous Next Index
Class com.roguewave.vsj.StoreTable
java.lang.Object
|
+----com.roguewave.vsj.StoreTable
- public class StoreTable
- extends Object
- implements SaveContext
Class StoreTable is an implementation of the SaveContext
interface meant to correspond to the store tables used in
Tools.h++ for doing both isomorphic and polymorphic persistence.
In particular, this implementation primes itself with the null
object at the start of each persistence context.
-
table_
- Implementation of StoreTable
-
StoreTable()
-
-
addElement(Object)
- Add an object to the StoreTable.
-
endContext()
- End the current persistence context.
-
inContext()
- Return true if StoreTable is currently within a persistence
context.
-
index(Object)
- Return the index of an object in the StoreTable.
-
newContext()
- Begin a new persistence context.
-
newContext(int)
- Begin a new persistence context with initial capacity
for the given number of objects.
table_
protected IdentityDictionary table_
- Implementation of StoreTable
StoreTable
public StoreTable()
newContext
public void newContext()
- Begin a new persistence context. A persistence context
defines the scope of back references used for isomorphic
persistence.
newContext
public void newContext(int initCapacity)
- Begin a new persistence context with initial capacity
for the given number of objects. A persistence context
defines the scope of back references used for isomorphic
persistence.
inContext
public boolean inContext()
- Return true if StoreTable is currently within a persistence
context. That is, returns true if newContext() has been
called, but endContext() has not.
endContext
public void endContext()
- End the current persistence context. A persistence context
defines the scope of back references used for isomorphic
persistence.
Note that the StoreTable will maintain a reference
to every object added since the call to newContext(). Thus
you must call this method in order for those objects to
be available for garbage collection before either newContext()
is called again or the StoreTable itself is reclaimed.
addElement
public void addElement(Object obj)
- Add an object to the StoreTable.
index
public int index(Object obj)
- Return the index of an object in the StoreTable. The index
can be used for back referencing an object already stored.
- Returns:
- The reference number of the object, or -1 if the
object is not in the StoreTable
All Packages Class Hierarchy This Package Previous Next Index