org.geotools.graph.traverse.basic
Class SimpleGraphWalker

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

public class SimpleGraphWalker
extends java.lang.Object
implements GraphWalker

A simple implementation of GraphWalker that decorates a GraphVisitor.

Author:
Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net

Constructor Summary
SimpleGraphWalker(GraphVisitor visitor)
          Creates a GraphWalker from a preexising GraphVisitor.
 
Method Summary
 void finish()
          Does nothing.
 GraphVisitor getVistor()
          Returns the underlying visitor.
 void setVisitor(GraphVisitor visitor)
          Sets the underlying visitor.
 int visit(Graphable element, GraphTraversal traversal)
          Defers to the 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.

Parameters:
visitor - The visitor to decorate
Method Detail

getVistor

public GraphVisitor getVistor()
Returns the underlying visitor.

Returns:
The visitor being decorated by the walker.

setVisitor

public void setVisitor(GraphVisitor visitor)
Sets the underlying visitor.

Parameters:
visitor - The visitor to be decorated by the walker.

visit

public int visit(Graphable element,
                 GraphTraversal traversal)
Defers to the underlying visitor.

Specified by:
visit in interface GraphWalker
Parameters:
element - The component being visited.
traversal - The traversal controlling the sequence of graph component visits.
Returns:
GraphTraversal#CONTINUE to signal that the traversal should continue.
GraphTraversal#CONTINUE to signal that the traversal should suspend.
GraphTraversal#KILL_BRANCH to signal that the traversal should kill its current branch.
GraphTraversal#STOP to signal that the traversal should stop.
See Also:
GraphWalker.visit(Graphable, GraphTraversal)

finish

public void finish()
Does nothing.

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


Copyright © GeoTools. All Rights Reserved.