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.-
Nested Class Summary
Nested classes/interfaces inherited from interface Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR> -
Field Summary
FieldsFields inherited from interface Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
ConstructorsConstructorDescriptionCloseableIterationSpliterator(CloseableIteration<T, E> iteration) Creates aSpliteratorimplementation that wraps the suppliedCloseableIteration. -
Method Summary
Modifier and TypeMethodDescriptionvoidforEachRemaining(Consumer<? super T> action) booleantryAdvance(Consumer<? super T> action) Methods inherited from class Spliterators.AbstractSpliterator
characteristics, estimateSize, trySplitMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Spliterator
getComparator, getExactSizeIfKnown, hasCharacteristics
-
Field Details
-
iteration
-
-
Constructor Details
-
CloseableIterationSpliterator
Creates aSpliteratorimplementation that wraps the suppliedCloseableIteration. 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
-
forEachRemaining
-