| com.versant.core.server.OIDGraph com.versant.core.server.PersistGraph
All known Subclasses: com.versant.core.server.PersistGraphFullSort,
PersistGraph | public class PersistGraph extends OIDGraph (Code) | | A graph of OID's and State's used to represent a collection of objects
to be persisted. This class implements algorithms to sort the graph
for persisting in the correct order and to detect cycles. This class
only does a partial sort of the graph and is suitable for graphs that
do not contain any new instances with post-insert key generators.
|
Method Summary | |
public void | add(OID oid, State oldState, State newState) Add a node to the graph. | public void | clear() Empty the graph so it can be reused. | protected int | compare(int a, int b) Compare graph entries at and a and b. | public void | doAutoSets() Bump up timestamps etc. | public void | dump() Dump the graph to System.out for debugging. | public void | dump(int index) Dump entries at index to System.out for debugging. | public State | getNewState(int index) Get the new State at index. | public OID | getOID(int index) Get the OID at index. | public State | getOldState(int index) Get the old State at index. | public int | indexOf(OID oid) Find the index of OID in the graph or less than 0 if not found. | public int | indexOfAfterPersist(OID oid) Find the index of OID in the graph or less than 0 if not found.
This method may be called after persist has been called. | public int | size() | protected void | swap(int index1, int index2) Swap entries. |
optimistic | public boolean optimistic(Code) | | |
clear | public void clear()(Code) | | Empty the graph so it can be reused.
|
compare | protected int compare(int a, int b)(Code) | | Compare graph entries at and a and b. Return 0 if equal, less than 0
if a is less than b or greater than 0 if a is greater than b. This
orders entries by class referenceGraphIndex, by new objects first,
by field numbers.
|
doAutoSets | public void doAutoSets()(Code) | | Bump up timestamps etc.
|
dump | public void dump()(Code) | | Dump the graph to System.out for debugging.
|
dump | public void dump(int index)(Code) | | Dump entries at index to System.out for debugging.
|
getNewState | public State getNewState(int index)(Code) | | Get the new State at index.
|
getOID | public OID getOID(int index)(Code) | | Get the OID at index.
|
getOldState | public State getOldState(int index)(Code) | | Get the old State at index.
|
indexOf | public int indexOf(OID oid)(Code) | | Find the index of OID in the graph or less than 0 if not found.
Calling this method after persist has been called will return incorrect
results.
See Also: PersistGraph.indexOfAfterPersist |
indexOfAfterPersist | public int indexOfAfterPersist(OID oid)(Code) | | Find the index of OID in the graph or less than 0 if not found.
This method may be called after persist has been called. It will
build the OID to index map the first time it is called.
See Also: PersistGraph.indexOf |
size | public int size()(Code) | | How many nodes are in the graph?
|
swap | protected void swap(int index1, int index2)(Code) | | Swap entries.
|
Methods inherited from com.versant.core.server.OIDGraph | abstract public int indexOf(OID oid)(Code)(Java Doc)
|
|
|