Class BlossomVNode.IncidentEdgeIterator

java.lang.Object
org.jgrapht.alg.matching.blossom.v5.BlossomVNode.IncidentEdgeIterator
All Implemented Interfaces:
Iterator<BlossomVEdge>
Enclosing class:
BlossomVNode

public class BlossomVNode.IncidentEdgeIterator extends Object implements Iterator<BlossomVEdge>
An iterator for traversing the edges incident to this node.

This iterator has a feature that during every step it knows the next edge it'll return to the caller. That's why it is safe to modify the current edge (move it to another node, for example).

  • Field Details

    • currentDir

      private int currentDir
      The direction of the current edge
    • nextDir

      private int nextDir
      Direction of the nextEdge
    • nextEdge

      private BlossomVEdge nextEdge
      The edge that will be returned after the next call to next(). Is null if all incident edges of the current node have been traversed.
  • Constructor Details

    • IncidentEdgeIterator

      public IncidentEdgeIterator()
      Constructs a new instance of the IncidentEdgeIterator.
  • Method Details

    • getDir

      public int getDir()
      Returns the direction of the edge returned by this iterator
      Returns:
      the direction of the edge returned by this iterator
    • hasNext

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

      public BlossomVEdge next()
      Specified by:
      next in interface Iterator<BlossomVEdge>
    • advance

      private void advance()
      Advances this iterator to the next incident edge. If previous edge was the last one with direction 0, then the direction of this iterator changes. If previous edge was the last incident edge, then nextEdge becomes null.