org.geotools.graph.traverse
Class AbstractGraphTraversal

java.lang.Object
  extended byorg.geotools.graph.traverse.AbstractGraphTraversal
All Implemented Interfaces:
GraphTraversal
Direct Known Subclasses:
BasicGraphTraversal, SourceGraphTraversal, TopologicalTraversal

public abstract class AbstractGraphTraversal
extends java.lang.Object
implements GraphTraversal

An abstract implementation of GraphTraversal.


Field Summary
 
Fields inherited from interface org.geotools.graph.traverse.GraphTraversal
CONTINUE, STOP
 
Constructor Summary
AbstractGraphTraversal(Graph graph, GraphWalker walker)
           
 
Method Summary
 void finish()
          Signals to the walker that the traversal is complete.
 Graph getGraph()
          Returns the graph the traversal is being made upon.
 GraphWalker getWalker()
          Returns the GraphWalker whom the traversal is dispatching to elements in the graph.
 void initEdges()
          Initializes the edges of a graph by delegating initialization to the walker.
 void initNodes()
          Initializes the nodes of a graph by delegating initialization to the walker.
abstract  void walkEdges()
          Performs the walking algorithm among the edges of the graph.
abstract  void walkNodes()
          Performs the walking algorithm among the nodes of the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGraphTraversal

public AbstractGraphTraversal(Graph graph,
                              GraphWalker walker)
Method Detail

getGraph

public Graph getGraph()
Description copied from interface: GraphTraversal
Returns the graph the traversal is being made upon.

Specified by:
getGraph in interface GraphTraversal
See Also:
GraphTraversal.getGraph()

getWalker

public GraphWalker getWalker()
Description copied from interface: GraphTraversal
Returns the GraphWalker whom the traversal is dispatching to elements in the graph.

Specified by:
getWalker in interface GraphTraversal
See Also:
GraphTraversal.getWalker()

initNodes

public void initNodes()
Initializes the nodes of a graph by delegating initialization to the walker.

Specified by:
initNodes in interface GraphTraversal
See Also:
GraphTraversal.initNodes()

initEdges

public void initEdges()
Initializes the edges of a graph by delegating initialization to the walker.

Specified by:
initEdges in interface GraphTraversal
See Also:
GraphTraversal.initNodes()

finish

public void finish()
Signals to the walker that the traversal is complete.

Specified by:
finish in interface GraphTraversal
See Also:
GraphTraversal.finish()

walkNodes

public abstract void walkNodes()
Performs the walking algorithm among the nodes of the graph.

Specified by:
walkNodes in interface GraphTraversal

walkEdges

public abstract void walkEdges()
Performs the walking algorithm among the edges of the graph.

Specified by:
walkEdges in interface GraphTraversal