| org.geotools.graph.traverse.GraphTraversal
All known Subclasses: org.geotools.graph.traverse.basic.BasicGraphTraversal,
GraphTraversal | public interface GraphTraversal (Code) | | Iterates a GraphWalker over the
components of a Graph. The order in which components are iterated over
is determined by the GraphIterator class. The GraphTraversal is
the mediator between the GraphWalker and the GraphIterator.
Upon each visitation, the GraphWalker communicates to the GraphTraversal
through a series of return codes, each specifying a different action to
perform at that point of the travesal. The following summarizes the meaning
of the codes.
Code |
Action Taken |
CONTINUE |
The traversal continues as normal. |
SUSPEND |
Suspends the traversal at some intermediate stage. This code
should be returned if the traversal is intended to be resumed. |
KILL_BRANCH |
Kills the current branch of the traversal. Depending on the iteration
algorithm, returning this code may end the traversal. |
STOP |
Stops the traversal. |
GraphTraversals are started with a call to traverse(). If the traversal is
suspended at some intermediate point, an additional call to traverse() will
resume the traversal.
See Also: GraphWalker See Also: GraphIterator See Also: Graph author: Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net |
Method Summary | |
public Graph | getGraph() Returns the graph being traversed. | public GraphIterator | getIterator() Returns the iterator that specifies the order in which to visit graph
components. | public GraphWalker | getWalker() Returns the walker (visitor) traversing the graph of the graph. | public void | init() Initializes the traversal. | public boolean | isVisited(Graphable g) | public void | setGraph(Graph graph) Sets the graph being traversed.
Parameters: graph - The graph whose components are being traversed. | public void | setIterator(GraphIterator iterator) Sets the iterator that specifies the order in which visit graph components. | public void | setVisited(Graphable g, boolean visited) | public void | setWalker(GraphWalker walker) Sets the walker (visitor) traversing the graph. | public void | traverse() Starts or resumes a traversal over the components of a graph. |
CONTINUE | public static int CONTINUE(Code) | | Signals the traversal to continue *
|
KILL_BRANCH | public static int KILL_BRANCH(Code) | | Signals the traversal to kill the current branch *
|
STOP | public static int STOP(Code) | | Signals the traversal to stop *
|
SUSPEND | public static int SUSPEND(Code) | | Signals the traversal to suspend at some intermediate point *
|
getGraph | public Graph getGraph()(Code) | | Returns the graph being traversed.
The graph whose components are being traversed. See Also: Graph |
getIterator | public GraphIterator getIterator()(Code) | | Returns the iterator that specifies the order in which to visit graph
components.
The iterator over the graph components. See Also: GraphIterator |
getWalker | public GraphWalker getWalker()(Code) | | Returns the walker (visitor) traversing the graph of the graph.
The walker being iterated over the components. |
init | public void init()(Code) | | Initializes the traversal.
|
setGraph | public void setGraph(Graph graph)(Code) | | Sets the graph being traversed.
Parameters: graph - The graph whose components are being traversed. |
setIterator | public void setIterator(GraphIterator iterator)(Code) | | Sets the iterator that specifies the order in which visit graph components.
Parameters: iterator - The iterator over the graph components. |
setWalker | public void setWalker(GraphWalker walker)(Code) | | Sets the walker (visitor) traversing the graph.
Parameters: walker - The walker being iterated over the components of the graph. |
traverse | public void traverse()(Code) | | Starts or resumes a traversal over the components of a graph.
|
|
|