Class CloseableIterationSpliterator<T,E extends Exception>

java.lang.Object
java.util.Spliterators.AbstractSpliterator<T>
org.eclipse.rdf4j.common.iteration.CloseableIterationSpliterator<T,E>
All Implemented Interfaces:
Spliterator<T>

class CloseableIterationSpliterator<T,E extends Exception> extends Spliterators.AbstractSpliterator<T>
A Spliterator implementation that wraps a CloseableIteration.
  • Field Details

  • Constructor Details

    • CloseableIterationSpliterator

      public CloseableIterationSpliterator(CloseableIteration<T,E> iteration)
      Creates a Spliterator implementation that wraps the supplied CloseableIteration. It handles occurrence of checked exceptions by wrapping them in RuntimeException, and in addition ensures that the wrapped iteration is closed when exhausted.
      Parameters:
      iteration - the iteration to wrap
  • Method Details

    • tryAdvance

      public boolean tryAdvance(Consumer<? super T> action)
    • forEachRemaining

      public void forEachRemaining(Consumer<? super T> action)