Class AbortiveMultiIterator<T>

java.lang.Object
org.apache.tinkerpop.gremlin.util.iterator.AbortiveMultiIterator<T>
All Implemented Interfaces:
Serializable, AutoCloseable, Iterator<T>

public final class AbortiveMultiIterator<T> extends Object implements Iterator<T>, Serializable, AutoCloseable
An Iterator that checks a Predicate prior to processing the specified child Iterator instances.
See Also:
  • Constructor Details

    • AbortiveMultiIterator

      public AbortiveMultiIterator()
  • Method Details

    • addIterator

      public void addIterator(Iterator<T> iterator)
      Adds an Iterator that will always be iterated.
    • addIterator

      public void addIterator(Iterator<T> iterator, Predicate<Long> check)
      Adds an Iterator that will iterate only if the check passes.
      Parameters:
      check - when returning true processing of the associated Iterator will proceed
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
    • clear

      public void clear()
    • close

      public void close()
      Close the underlying iterators if auto-closeable. Note that when Exception is thrown from any iterator in the for loop on closing, remaining iterators possibly left unclosed.
      Specified by:
      close in interface AutoCloseable