org.geotools.graph.traverse
Class SimpleGraphWalker

java.lang.Object
  extended byorg.geotools.graph.traverse.SimpleGraphWalker
All Implemented Interfaces:
GraphWalker

public class SimpleGraphWalker
extends java.lang.Object
implements GraphWalker

A simple implentation of GraphWalker that decorates a GraphVisitor.


Constructor Summary
SimpleGraphWalker(GraphVisitor visitor)
          Creates a GraphWalker from a preexising GraphVisitor
 
Method Summary
 void finish()
          Does nothing.
 void init(GraphComponent element)
          Resets visited flag and counter.
 boolean isVisited(GraphComponent element)
          Returns the visited flag of the graph component.
 int visit(GraphComponent element, GraphTraversal traversal)
          Sets the visted flag, and passes the element on to underlying visitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGraphWalker

public SimpleGraphWalker(GraphVisitor visitor)
Creates a GraphWalker from a preexising GraphVisitor

Method Detail

init

public void init(GraphComponent element)
Resets visited flag and counter.

Specified by:
init in interface GraphWalker
See Also:
GraphWalker.init(GraphComponent)

isVisited

public boolean isVisited(GraphComponent element)
Returns the visited flag of the graph component.

Specified by:
isVisited in interface GraphWalker
See Also:
GraphWalker.isVisited(GraphComponent)

visit

public int visit(GraphComponent element,
                 GraphTraversal traversal)
Sets the visted flag, and passes the element on to underlying visitor.

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

finish

public void finish()
Does nothing.

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