| java.lang.Object com.versant.core.common.SortableBase com.versant.core.metadata.ClassReferenceGraph
ClassReferenceGraph | final public class ClassReferenceGraph extends SortableBase (Code) | | This does a topological sort of a graph of ClassMetaData using direct
references between the classes as edges. Each class has its
referenceClassDepth field filled by sort. Cycles are detected and all
classes involved in a cycle have their referenceGraphCycle flags set. This
is used to not generate constraints for these fields. The
referenceClassDepth is used to order deletes to avoid tripping
constraints.
Only top level classes are actually sorted and the results are applied to
all subclasses. This is because heirachies are mapped into the table for
the base class. References in subclasses are considered as edges of the
base class in the graph.
See Also: ClassMetaData.referenceGraphIndex See Also: ClassMetaData.referenceGraphCycle |
Method Summary | |
protected int | compare(int a, int b) Compare entries at and a and b. | public static void | sort(ClassMetaData[] classes) Fill in the referenceGraphIndex and referenceGraphCycle fields for all
classes in jmd. | public void | sort() Sort the graph and set the referenceGraphIndex and referenceGraphCycle
fields on each class. | protected void | swap(int i1, int i2) Swap entries. |
compare | protected int compare(int a, int b)(Code) | | Compare 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.
|
swap | protected void swap(int i1, int i2)(Code) | | Swap entries.
|
Fields inherited from com.versant.core.common.SortableBase | protected int size(Code)(Java Doc)
|
|
|