Class MemTripleIterator<X extends Exception>
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<MemTriple, X>
org.eclipse.rdf4j.common.iteration.LookAheadIteration<MemTriple, X>
org.eclipse.rdf4j.sail.memory.model.MemTripleIterator<X>
- All Implemented Interfaces:
AutoCloseable, CloseableIteration<MemTriple, X>, Iteration<MemTriple, X>
An Iteration that can iterate over a list of
Triple objects.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MemValueThe object of statements to return, or null if any object is OK.private final MemIRIThe predicate of statements to return, or null if any predicate is OK.private final intIndicates which snapshot should be iterated over.private intThe index of the last statement that has been returned.private final MemStatement[]The lists of statements over which to iterate.private final intprivate final MemResourceThe subject of statements to return, or null if any subject is OK. -
Constructor Summary
ConstructorsConstructorDescriptionMemTripleIterator(MemStatementList statementList, MemResource subject, MemIRI predicate, MemValue object, int snapshot) Creates a new MemTripleIterator that will iterate over the triples contained in the supplied MemStatementList searching for triples that occur as either subject or object in those statements, and which match the specified pattern of subject, predicate, object. -
Method Summary
Modifier and TypeMethodDescriptionprotected MemTripleSearches through statementList, starting from index _nextStatementIdx + 1, for triples that match the constraints that have been set for this iterator.private booleanMethods inherited from class LookAheadIteration
handleClose, hasNext, next, removeMethods inherited from class AbstractCloseableIteration
close, isClosedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseableIteration
stream
-
Field Details
-
statementList
The lists of statements over which to iterate. -
subject
The subject of statements to return, or null if any subject is OK. -
predicate
The predicate of statements to return, or null if any predicate is OK. -
object
The object of statements to return, or null if any object is OK. -
snapshot
private final int snapshotIndicates which snapshot should be iterated over. -
statementListSize
private final int statementListSize -
statementIndex
private int statementIndexThe index of the last statement that has been returned.
-
-
Constructor Details
-
MemTripleIterator
public MemTripleIterator(MemStatementList statementList, MemResource subject, MemIRI predicate, MemValue object, int snapshot) throws InterruptedException Creates a new MemTripleIterator that will iterate over the triples contained in the supplied MemStatementList searching for triples that occur as either subject or object in those statements, and which match the specified pattern of subject, predicate, object.- Parameters:
statementList- the statements over which to iterate.subject- subject of pattern.predicate- predicate of pattern.object- object of pattern.- Throws:
InterruptedException
-
-
Method Details
-
getNextElement
Searches through statementList, starting from index _nextStatementIdx + 1, for triples that match the constraints that have been set for this iterator.- Specified by:
getNextElementin classLookAheadIteration<MemTriple, X extends Exception>- Returns:
- The next element, or null if no more elements are available.
-
isInSnapshot
-