Class HepVertexIterator<V extends HepRelVertex>

java.lang.Object
org.apache.calcite.plan.hep.HepVertexIterator<V>
Type Parameters:
V - Vertex type
All Implemented Interfaces:
Iterator<V>

public class HepVertexIterator<V extends HepRelVertex> extends Object implements Iterator<V>
Iterates over the vertices in a HepVertex graph in depth-first order. In a HepVertex graph, every HepVertex.getCurrentRel().getInputs() is a List<HepRelVertex>.
  • Method Details

    • of

      protected static <V extends HepRelVertex> Iterable<V> of(V root, Set<Integer> visitedSet)
      Creates a HepVertexIterator for a given HepVertex root.
      Parameters:
      root - Root of iteration.
      visitedSet - Set of HepVertex IDs to exclude from iteration; next() will add more items to it.
    • continueFrom

      public Iterator<V> continueFrom(V newVertex)
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<V extends HepRelVertex>
    • next

      public V next()
      Specified by:
      next in interface Iterator<V extends HepRelVertex>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<V extends HepRelVertex>