java.lang.Object
org.apache.jena.mem2.spliterator.ArraySubSpliterator<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
Spliterator<E>
A spliterator for arrays. This spliterator will iterate over the array
entries within the given boundaries.
This spliterator supports splitting into sub-spliterators.
The spliterator will check for concurrent modifications by invoking a Runnable
before each action.
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T extends Object,
T_CONS extends Object, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Constructor Summary
ConstructorsConstructorDescriptionArraySubSpliterator
(E[] entries, int fromIndex, int toIndex, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size.ArraySubSpliterator
(E[] entries, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size. -
Method Summary
Modifier and TypeMethodDescriptionint
long
void
forEachRemaining
(Consumer<? super E> action) boolean
tryAdvance
(Consumer<? super E> action) trySplit()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Spliterator
getComparator, getExactSizeIfKnown, hasCharacteristics
-
Constructor Details
-
ArraySubSpliterator
public ArraySubSpliterator(E[] entries, int fromIndex, int toIndex, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size.- Parameters:
entries
- the arrayfromIndex
- the index of the first element, inclusivetoIndex
- the index of the last element, exclusivecheckForConcurrentModification
- runnable to check for concurrent modifications
-
ArraySubSpliterator
Create a spliterator for the given array, with the given size.- Parameters:
entries
- the arraycheckForConcurrentModification
- runnable to check for concurrent modifications
-
-
Method Details
-
tryAdvance
- Specified by:
tryAdvance
in interfaceSpliterator<E>
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceSpliterator<E>
-
trySplit
- Specified by:
trySplit
in interfaceSpliterator<E>
-
estimateSize
public long estimateSize()- Specified by:
estimateSize
in interfaceSpliterator<E>
-
characteristics
public int characteristics()- Specified by:
characteristics
in interfaceSpliterator<E>
-