|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.graph.util.graph.CycleDetector
Detects cycles in a graph. A topological iteration of the nodes of the graph is performed. If the iteration includes all nodes in the graph then the graph is cycle free, otherwise a cycle exists.
BreadthFirstTopologicalIterator| Constructor Summary | |
CycleDetector(Graph graph)
Constructs a new CycleDetector. |
|
| Method Summary | |
boolean |
containsCycle()
Performs the iteration to determine if a cycle exits in the graph. |
protected GraphIterator |
createIterator()
Creates the iterator to be used in the cycle detection. |
void |
finish()
Does nothing. |
int |
visit(Graphable element,
GraphTraversal traversal)
Increments the count of nodes visited. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CycleDetector(Graph graph)
graph - The graph to be tested for cycle existance.| Method Detail |
public boolean containsCycle()
public int visit(Graphable element,
GraphTraversal traversal)
visit in interface GraphWalkerelement - The component being visited.traversal - The traversal controlling the sequence of graph
component visits.
GraphWalker.visit(Graphable, GraphTraversal)public void finish()
finish in interface GraphWalkerGraphWalker.finish()protected GraphIterator createIterator()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||