org.geotools.graph.traverse
Class SourceGraphTraversal

java.lang.Object
  extended byorg.geotools.graph.traverse.AbstractGraphTraversal
      extended byorg.geotools.graph.traverse.SourceGraphTraversal
All Implemented Interfaces:
GraphTraversal
Direct Known Subclasses:
BreadthFirstTraversal, DepthFirstTraversal, DijkstraTraversal, ReverseDepthFirstTraversal

public abstract class SourceGraphTraversal
extends AbstractGraphTraversal

A GraphTraversal that is intened to start from a single graph componenet. This component is known as the source of the traversal.


Field Summary
 
Fields inherited from interface org.geotools.graph.traverse.GraphTraversal
CONTINUE, STOP
 
Constructor Summary
SourceGraphTraversal(Graph graph, GraphWalker walker, GraphComponent source)
           
 
Method Summary
abstract  java.util.Collection getActiveElements()
          Returns the active elements of the traversal.
 GraphComponent getSource()
          Returns the source of the traversal.
protected abstract  void walk()
           
 void walkEdges()
          Performs the walking algorithm among the edges of the graph.
 void walkNodes()
          Performs the walking algorithm among the nodes of the graph.
 
Methods inherited from class org.geotools.graph.traverse.AbstractGraphTraversal
finish, getGraph, getWalker, initEdges, initNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceGraphTraversal

public SourceGraphTraversal(Graph graph,
                            GraphWalker walker,
                            GraphComponent source)
Method Detail

getSource

public GraphComponent getSource()
Returns the source of the traversal.


walkNodes

public void walkNodes()
Description copied from class: AbstractGraphTraversal
Performs the walking algorithm among the nodes of the graph.

Specified by:
walkNodes in interface GraphTraversal
Specified by:
walkNodes in class AbstractGraphTraversal
See Also:
GraphTraversal.walkNodes()

walkEdges

public void walkEdges()
Description copied from class: AbstractGraphTraversal
Performs the walking algorithm among the edges of the graph.

Specified by:
walkEdges in interface GraphTraversal
Specified by:
walkEdges in class AbstractGraphTraversal
See Also:
GraphTraversal.walkEdges()

getActiveElements

public abstract java.util.Collection getActiveElements()
Returns the active elements of the traversal. That is elements that are in the process of being visited, or are queued to be visited.


walk

protected abstract void walk()