Module org.apache.jena.core
Package org.apache.jena.mem.spliterator
Class SparseArrayIndexedSpliterator<E>
java.lang.Object
org.apache.jena.mem.spliterator.SparseArrayIndexedSpliterator<E>
- Type Parameters:
E- the type of the array elements
- All Implemented Interfaces:
Spliterator<FastHashSet.IndexedKey<E>>
public class SparseArrayIndexedSpliterator<E>
extends Object
implements Spliterator<FastHashSet.IndexedKey<E>>
A spliterator for sparse arrays. This spliterator will iterate over the array
skipping null entries.
This spliterator returns elements as
FastHashSet.IndexedKey objects,
which contain both the index and the value of the element.
This spliterator works in ascending order, starting from the given start up to the specified exclusive index.
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,T_CONS, 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
ConstructorsConstructorDescriptionSparseArrayIndexedSpliterator(E[] entries, int fromIndexInclusive, int toIndexExclusive, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size.SparseArrayIndexedSpliterator(E[] entries, int toIndexExclusive, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size.SparseArrayIndexedSpliterator(E[] entries, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size. -
Method Summary
Modifier and TypeMethodDescriptionintlongvoidforEachRemaining(Consumer<? super FastHashSet.IndexedKey<E>> action) booleantryAdvance(Consumer<? super FastHashSet.IndexedKey<E>> action) trySplit()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Spliterator
getComparator, getExactSizeIfKnown, hasCharacteristics
-
Constructor Details
-
SparseArrayIndexedSpliterator
public SparseArrayIndexedSpliterator(E[] entries, int fromIndexInclusive, int toIndexExclusive, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size.- Parameters:
entries- the arrayfromIndexInclusive- the index of the first element, inclusivetoIndexExclusive- the index of the last element, exclusivecheckForConcurrentModification- runnable to check for concurrent modifications
-
SparseArrayIndexedSpliterator
public SparseArrayIndexedSpliterator(E[] entries, int toIndexExclusive, Runnable checkForConcurrentModification) Create a spliterator for the given array, with the given size.- Parameters:
entries- the arraytoIndexExclusive- the index of the last element, exclusivecheckForConcurrentModification- runnable to check for concurrent modifications
-
SparseArrayIndexedSpliterator
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:
tryAdvancein interfaceSpliterator<E>
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceSpliterator<E>
-
trySplit
- Specified by:
trySplitin interfaceSpliterator<E>
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<E>
-
characteristics
public int characteristics()- Specified by:
characteristicsin interfaceSpliterator<E>
-