Class NoBifurcationIterator

  • All Implemented Interfaces:
    GraphIterator

    public class NoBifurcationIterator
    extends SourceGraphIterator
    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 Detail

      • NoBifurcationIterator

        public NoBifurcationIterator()
    • Method Detail

      • init

        public void init​(Graph graph,
                         GraphTraversal traversal)
        Does nothing.
        Parameters:
        graph - The graph being whose components are being iterated over.
        See Also:
        GraphIterator#init(Graph)
      • next

        public Graphable 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.
        Returns:
        The next component in the iteration, or null if iteration is complete.
        See Also:
        org.geotools.graph.traverse.GraphIterator#next()
      • cont

        public void cont​(Graphable current,
                         GraphTraversal traversal)
        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

        public void killBranch​(Graphable current,
                               GraphTraversal traversal)
        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)