java.lang.Object
org.apache.jena.mem.store.indexed.IndexListsSpliterator
- All Implemented Interfaces:
Spliterator<Triple>
Spliterator counterpart to
IndexListsIterator: walks the
intersection of two IndexLists, dereferencing each surviving
triple index against a IndexedTripleSource. Supports recursive splitting
for parallel traversal; the split happens on the (smaller) list being
scanned, never on the larger list (which is only probed via its
reverse-index array).
Detects concurrent modifications by snapshotting triples.size() at
construction time and rechecking it at each advance/forEach boundary;
throws ConcurrentModificationException if the size has changed.
-
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
ConstructorsConstructorDescriptionIndexListsSpliterator(IndexedTripleSource source, IndexList indexListA, int[] reverseIndicesA, IndexList indexListB, int[] reverseIndicesB) Creates a spliterator over the triples whose indices appear in bothindexListAandindexListB. -
Method Summary
Modifier and TypeMethodDescriptionintlongvoidforEachRemaining(Consumer<? super Triple> action) longbooleantryAdvance(Consumer<? super Triple> 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, hasCharacteristics
-
Constructor Details
-
IndexListsSpliterator
public IndexListsSpliterator(IndexedTripleSource source, IndexList indexListA, int[] reverseIndicesA, IndexList indexListB, int[] reverseIndicesB) Creates a spliterator over the triples whose indices appear in bothindexListAandindexListB.- Parameters:
source- the canonical triple setindexListA- one of the index lists to intersectreverseIndicesA- reverse-index array forindexListAindexListB- the other index list to intersectreverseIndicesB- reverse-index array forindexListB
-
-
Method Details
-
tryAdvance
- Specified by:
tryAdvancein interfaceSpliterator<Triple>
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceSpliterator<Triple>
-
trySplit
- Specified by:
trySplitin interfaceSpliterator<Triple>
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<Triple>
-
getExactSizeIfKnown
public long getExactSizeIfKnown()- Specified by:
getExactSizeIfKnownin interfaceSpliterator<Triple>
-
characteristics
public int characteristics()- Specified by:
characteristicsin interfaceSpliterator<Triple>
-