Class BlossomVTree.TreeEdgeIterator

  • All Implemented Interfaces:
    java.util.Iterator<BlossomVTreeEdge>
    Enclosing class:
    BlossomVTree

    public class BlossomVTree.TreeEdgeIterator
    extends java.lang.Object
    implements java.util.Iterator<BlossomVTreeEdge>
    An iterator over tree edges incident to this tree.
    • Field Detail

      • currentDirection

        private int currentDirection
        The direction of the currentEdge
      • currentEdge

        private BlossomVTreeEdge currentEdge
        The tree edge this iterator is currently on
      • result

        private BlossomVTreeEdge result
        Variable to determine whether currentEdge has been returned or not
    • Constructor Detail

      • TreeEdgeIterator

        public TreeEdgeIterator()
        Constructs a new TreeEdgeIterator
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<BlossomVTreeEdge>
      • getCurrentDirection

        public int getCurrentDirection()
        Returns the direction of the current edge
        Returns:
        the direction of the current edge
      • advance

        private BlossomVTreeEdge advance()
        Moves this iterator to the next tree edge. If the last outgoing edge has been traversed, changes the current direction to 1. If the the last incoming edge has been traversed, sets currentEdge to null.
        Returns:
        the next tree edge or null if all edges have been traversed already