org.geotools.graph.util
Class CycleFinder

java.lang.Object
  extended byorg.geotools.graph.util.CycleFinder
All Implemented Interfaces:
GraphWalker

public class CycleFinder
extends java.lang.Object
implements GraphWalker


Constructor Summary
CycleFinder(Graph graph)
           
 
Method Summary
 void calculateCycle()
           
 boolean containsCycle()
           
 void finish()
          Called when the graph traversal is completed.
 java.util.List getCycleElements()
           
 void init(GraphComponent element)
          Inializes a graph component
 boolean isVisited(GraphComponent element)
          Determines if a graph component has been visited.
 int visit(GraphComponent element, GraphTraversal traversal)
          Visits a graph componenet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CycleFinder

public CycleFinder(Graph graph)
Method Detail

containsCycle

public boolean containsCycle()

calculateCycle

public void calculateCycle()

getCycleElements

public java.util.List getCycleElements()

visit

public int visit(GraphComponent element,
                 GraphTraversal traversal)
Description copied from interface: GraphWalker
Visits a graph componenet.

Specified by:
visit in interface GraphWalker
Parameters:
element - The component to visit.
traversal - The traversal controlling the sequence of graph component visits.

isVisited

public boolean isVisited(GraphComponent element)
Description copied from interface: GraphWalker
Determines if a graph component has been visited.

Specified by:
isVisited in interface GraphWalker

init

public void init(GraphComponent element)
Description copied from interface: GraphWalker
Inializes a graph component

Specified by:
init in interface GraphWalker

finish

public void finish()
Description copied from interface: GraphWalker
Called when the graph traversal is completed.

Specified by:
finish in interface GraphWalker