java.lang.Object
org.apache.jena.util.iterator.NiceIterator<Triple>
org.apache.jena.mem.store.indexed.IndexListsIterator
- All Implemented Interfaces:
Iterator<Triple>,org.apache.jena.atlas.iterator.IteratorCloseable<Triple>,org.apache.jena.atlas.lib.Closeable,ClosableIterator<Triple>,ExtendedIterator<Triple>
Iterator over the intersection of two
IndexLists, used by the
eager indexing strategy to answer two-key patterns
(e.g. subject-and-predicate or predicate-and-object).
The intersection is computed lazily: the iterator walks the shorter of
the two lists and probes each candidate triple index against the larger
list's reverse-index array. This gives expected
O(min(|A|, |B|)) cost without any explicit set-allocation.
Detects concurrent modifications by snapshotting triples.size() at
construction time and rechecking it on each call to next() /
forEachRemaining(Consumer); throws
ConcurrentModificationException if the size has changed.
-
Constructor Summary
ConstructorsConstructorDescriptionIndexListsIterator(IndexedTripleSource source, IndexList indexListA, int[] reverseIndicesA, IndexList indexListB, int[] reverseIndicesB) Creates an iterator over the triples whose indices appear in bothindexListAandindexListB. -
Method Summary
Methods inherited from class org.apache.jena.util.iterator.NiceIterator
andThen, andThen, asList, asSet, close, close, emptyIterator, filterDrop, filterKeep, mapWith, remove, removeNext, toList, toSetMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jena.util.iterator.ExtendedIterator
forEach, nextOptional
-
Constructor Details
-
IndexListsIterator
public IndexListsIterator(IndexedTripleSource source, IndexList indexListA, int[] reverseIndicesA, IndexList indexListB, int[] reverseIndicesB) Creates an iterator over the triples whose indices appear in bothindexListAandindexListB.- Parameters:
source- the canonical triple set to dereference indices againstindexListA- one of the index lists to intersectreverseIndicesA- reverse-index array forindexListAindexListB- the other index list to intersectreverseIndicesB- reverse-index array forindexListB
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from class:NiceIteratordefault hasNext: no elements, return false. -
next
Description copied from class:NiceIteratordefault next: throw an exception. -
forEachRemaining
-