Class BlossomVTree.TreeEdgeIterator

java.lang.Object
org.jgrapht.alg.matching.blossom.v5.BlossomVTree.TreeEdgeIterator
All Implemented Interfaces:
Iterator<BlossomVTreeEdge>
Enclosing class:
BlossomVTree

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

    • 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 Details

    • TreeEdgeIterator

      public TreeEdgeIterator()
      Constructs a new TreeEdgeIterator
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<BlossomVTreeEdge>
    • next

      public BlossomVTreeEdge next()
      Specified by:
      next in interface 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