public interface GraphTraversal
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. |
GraphWalker
,
GraphIterator
,
Graph
Modifier and Type | Field and Description |
---|---|
static int |
CONTINUE
Signals the traversal to continue *
|
static int |
KILL_BRANCH
Signals the traversal to kill the current branch *
|
static int |
STOP
Signals the traversal to stop *
|
static int |
SUSPEND
Signals the traversal to suspend at some intermediate point *
|
Modifier and Type | Method and Description |
---|---|
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()
Initialises the traversal.
|
boolean |
isVisited(Graphable g) |
void |
setGraph(Graph graph)
Sets the graph being traversed.
|
void |
setIterator(GraphIterator iterator)
Sets the iterator that specifies the order in which visit graph components.
|
void |
setVisited(Graphable g,
boolean visited) |
void |
setWalker(GraphWalker walker)
Sets the walker (visitor) traversing the graph.
|
void |
traverse()
Starts or resumes a traversal over the components of a graph.
|
static final int CONTINUE
static final int SUSPEND
static final int KILL_BRANCH
static final int STOP
void setGraph(Graph graph)
graph
- The graph whose components are being traversed.Graph getGraph()
Graph
void setIterator(GraphIterator iterator)
iterator
- The iterator over the graph components.GraphIterator getIterator()
GraphIterator
void setWalker(GraphWalker walker)
walker
- The walker being iterated over the components of the graph.GraphWalker getWalker()
void init()
void traverse()
boolean isVisited(Graphable g)
void setVisited(Graphable g, boolean visited)
Copyright © 1996–2023 Geotools. All rights reserved.