|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.graph.traverse.basic.BasicGraphTraversal
A basic implementation of GraphTraversal.
| Field Summary |
| Fields inherited from interface org.geotools.graph.traverse.GraphTraversal |
CONTINUE, KILL_BRANCH, STOP, SUSPEND |
| Constructor Summary | |
BasicGraphTraversal(Graph graph,
GraphWalker walker,
GraphIterator iterator)
Constrcuts a new graph traversal. |
|
| Method Summary | |
Graph |
getGraph()
Returns the graph being traversed. |
GraphIterator |
getIterator()
Returns the iterator that specifies the order in which to visit graph components. |
GraphWalker |
getWalker()
Returns the walker (visitor) traversing the graph of the graph. |
void |
init()
Resets the visited flag and counts of all nodes of the graph. |
boolean |
isVisited(Graphable g)
|
void |
setGraph(Graph graph)
Sets the graph being traversed. |
void |
setIterator(GraphIterator iterator)
Sets the iterator and intializes it. |
void |
setVisited(Graphable g,
boolean visited)
|
void |
setWalker(GraphWalker walker)
Sets the walker (visitor) traversing the graph. |
void |
traverse()
Upon each iteration of the traversal, a component is returned from the iterator and passed to the visitor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BasicGraphTraversal(Graph graph,
GraphWalker walker,
GraphIterator iterator)
graph - The graph being traversed.walker - The walker being traversed over the components of the graph.iterator - The iterator specifying the order in which to visit
components of the graph.| Method Detail |
public void setGraph(Graph graph)
GraphTraversal
setGraph in interface GraphTraversalgraph - The graph whose components are being traversed.GraphTraversal.setGraph(Graph)public Graph getGraph()
GraphTraversal
getGraph in interface GraphTraversalGraphTraversal.getGraph()public void setIterator(GraphIterator iterator)
setIterator in interface GraphTraversaliterator - The iterator over the graph components.GraphIterator#init(Graph),
GraphTraversal.setIterator(GraphIterator)public GraphIterator getIterator()
GraphTraversal
getIterator in interface GraphTraversalGraphTraversal.getIterator()public void setWalker(GraphWalker walker)
GraphTraversal
setWalker in interface GraphTraversalwalker - The walker being iterated over the components of the graph.GraphTraversal.setWalker(GraphWalker)public GraphWalker getWalker()
GraphTraversal
getWalker in interface GraphTraversalGraphTraversal.getWalker()public void init()
init in interface GraphTraversalGraphTraversal.init()public void traverse()
| Code | Action Performed |
|---|---|
| CONTINUE | The traversal instructs the iterator to continue and starts the next stage of iteration. |
| SUSPEND | The traversal instructs the iterator to continue but does not start the next stage of iteration, returning from traverse(). |
| KILL_BRANCH | The traversal instructs the iterator to kill the current branch and starts the next stage of iteration. |
| STOP | The traversal does not instruct the iterator to continue and does not start the next of iteration, returning from traverse() |
traverse in interface GraphTraversalGraphTraversal.traverse()
public void setVisited(Graphable g,
boolean visited)
setVisited in interface GraphTraversalpublic boolean isVisited(Graphable g)
isVisited in interface GraphTraversal
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||