|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.lib.graph.DepthFirstAnalysis
public class DepthFirstAnalysis
Performs a depth-first analysis of a given Graph
, caching
information about the graph's nodes and edges. See the DFS algorithm
in the book 'Introduction to Algorithms' by Cormen, Leiserson, and
Rivest. The algorithm has been modified to group sibling nodes without
connections together during the topological sort.
Constructor Summary | |
---|---|
DepthFirstAnalysis(Graph graph)
Constructor. |
Method Summary | |
---|---|
Collection<Edge> |
getEdges(int type)
Return all edges of the given type. |
int |
getFinishedTime(Object node)
Return the logical time that the given node was finished in the graph walk, or -1 if the node is not part of the graph. |
List<Object> |
getSortedNodes()
Return the nodes in topologically-sorted order. |
boolean |
hasNoCycles()
Test, if the analysis didn't find cycles. |
void |
setNodeComparator(Comparator<Object> comp)
Set the comparator that should be used for ordering groups of nodes with the same dependencies. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DepthFirstAnalysis(Graph graph)
Method Detail |
---|
public void setNodeComparator(Comparator<Object> comp)
public List<Object> getSortedNodes()
public Collection<Edge> getEdges(int type)
Edge.TYPE_BACK
or Edge.TYPE_FORWARD
edge type.
public int getFinishedTime(Object node)
public boolean hasNoCycles()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |