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 java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,
T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
FieldsFields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Constructor Summary
ConstructorsConstructorDescriptionCloseableIterationSpliterator
(CloseableIteration<T, E> iteration) Creates aSpliterator
implementation that wraps the suppliedCloseableIteration
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
forEachRemaining
(Consumer<? super T> action) boolean
tryAdvance
(Consumer<? super T> action) Methods inherited from class java.util.Spliterators.AbstractSpliterator
characteristics, estimateSize, trySplit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Spliterator
getComparator, getExactSizeIfKnown, hasCharacteristics
-
Field Details
-
iteration
-
-
Constructor Details
-
CloseableIterationSpliterator
Creates aSpliterator
implementation 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
-