Class NoBifurcationIterator
Object
AbstractGraphIterator
SourceGraphIterator
NoBifurcationIterator
- All Implemented Interfaces:
GraphIterator
Iterates over the nodes of a graph starting from a specified node, stopping at a bifurcation. A bifurcation is
defined as a node of degree > 2. The following figures illustrate examples of the iterator.




- Author:
- Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cont
(Graphable current, GraphTraversal traversal) Searches for the next node to be returned in the iteration.void
init
(Graph graph, GraphTraversal traversal) Does nothing.void
killBranch
(Graphable current, GraphTraversal traversal) Kills the current branch of the iteration by explicitly setting the next node to be returned to null.next
(GraphTraversal traversal) The next node in the iteration is the first node found adjacent to the current node that is non visited and of degree less than 2.void
Sets the source of the traversal.Methods inherited from class SourceGraphIterator
getSource
Methods inherited from class AbstractGraphIterator
getGraph, getTraversal, getWalker, setTraversal
-
Constructor Details
-
NoBifurcationIterator
public NoBifurcationIterator()
-
-
Method Details
-
init
Does nothing.- Parameters:
graph
- The graph being whose components are being iterated over.- See Also:
-
GraphIterator#init(Graph)
-
setSource
Sets the source of the traversal. This must be a node of degree less than or equal to 2.- Overrides:
setSource
in classSourceGraphIterator
- Parameters:
source
- node of degree less than or equal 2- See Also:
-
next
The next node in the iteration is the first node found adjacent to the current node that is non visited and of degree less than 2.- Returns:
- The next component in the iteration, or null if iteration is complete.
- See Also:
-
org.geotools.graph.traverse.GraphIterator#next()
-
cont
Searches for the next node to be returned in the iteration. The next node is the first node (of two) related to the current node that is non visited and of degree <= 2.- Parameters:
current
- The current component of the traversal.- See Also:
-
org.geotools.graph.traverse.GraphIterator#cont(Graphable)
-
killBranch
Kills the current branch of the iteration by explicitly setting the next node to be returned to null. This call always ends the traversal.- Parameters:
current
- The current component of the traversal.- See Also:
-
org.geotools.graph.traverse.GraphIterator#killBranch(Graphable)
-