Class MemTripleIterator<X extends java.lang.Exception>
- java.lang.Object
-
- org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
-
- org.eclipse.rdf4j.common.iteration.LookAheadIteration<MemTriple,X>
-
- org.eclipse.rdf4j.sail.memory.model.MemTripleIterator<X>
-
- All Implemented Interfaces:
java.lang.AutoCloseable,CloseableIteration<MemTriple,X>,Iteration<MemTriple,X>
public class MemTripleIterator<X extends java.lang.Exception> extends LookAheadIteration<MemTriple,X>
An Iteration that can iterate over a list ofTripleobjects.
-
-
Field Summary
Fields Modifier and Type Field Description private MemValueobjectThe object of statements to return, or null if any object is OK.private MemIRIpredicateThe predicate of statements to return, or null if any predicate is OK.private intsnapshotIndicates which snapshot should be iterated over.private intstatementIndexThe index of the last statement that has been returned.private MemStatement[]statementListThe lists of statements over which to iterate.private intstatementListSizeprivate MemResourcesubjectThe subject of statements to return, or null if any subject is OK.
-
Constructor Summary
Constructors Constructor Description MemTripleIterator(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MemTriplegetNextElement()Searches through statementList, starting from index _nextStatementIdx + 1, for triples that match the constraints that have been set for this iterator.private booleanisInSnapshot(MemStatement st)-
Methods inherited from class org.eclipse.rdf4j.common.iteration.LookAheadIteration
handleClose, hasNext, next, remove
-
Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
stream
-
-
-
-
Field Detail
-
statementList
private final MemStatement[] statementList
The lists of statements over which to iterate.
-
subject
private final MemResource subject
The subject of statements to return, or null if any subject is OK.
-
predicate
private final MemIRI predicate
The predicate of statements to return, or null if any predicate is OK.
-
object
private final MemValue object
The object of statements to return, or null if any object is OK.
-
snapshot
private final int snapshot
Indicates which snapshot should be iterated over.
-
statementListSize
private final int statementListSize
-
statementIndex
private int statementIndex
The index of the last statement that has been returned.
-
-
Constructor Detail
-
MemTripleIterator
public MemTripleIterator(MemStatementList statementList, MemResource subject, MemIRI predicate, MemValue object, int snapshot) throws java.lang.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:
java.lang.InterruptedException
-
-
Method Detail
-
getNextElement
protected MemTriple 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 java.lang.Exception>- Returns:
- The next element, or null if no more elements are available.
-
isInSnapshot
private boolean isInSnapshot(MemStatement st)
-
-