Class MemStatementIterator<X extends Exception>
- java.lang.Object
-
- org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
-
- org.eclipse.rdf4j.common.iteration.LookAheadIteration<MemStatement,X>
-
- org.eclipse.rdf4j.sail.memory.model.MemStatementIterator<X>
-
- All Implemented Interfaces:
AutoCloseable,CloseableIteration<MemStatement,X>,Iteration<MemStatement,X>
public class MemStatementIterator<X extends Exception> extends LookAheadIteration<MemStatement,X>
A StatementIterator that can iterate over a list of Statement objects. This iterator compares Resource and Literal objects using the '==' operator, which is possible thanks to the extensive sharing of these objects in the MemoryStore.
-
-
Constructor Summary
Constructors Constructor Description MemStatementIterator(MemStatementList statementList, MemResource subject, MemIRI predicate, MemValue object, Boolean explicit, int snapshot, MemResource... contexts)Creates a new MemStatementIterator that will iterate over the statements contained in the supplied MemStatementList searching for statements that match the specified pattern of subject, predicate, object and context(s).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CloseableIteration<MemStatement,SailException>cacheAwareInstance(MemStatementList smallestList, MemResource subj, MemIRI pred, MemValue obj, Boolean explicit, int snapshot, MemResource[] memContexts, MemStatementIteratorCache iteratorCache)booleanequals(Object o)protected MemStatementgetNextElement()Searches through statementList, starting from index _nextStatementIdx + 1, for statements that match the constraints that have been set for this iterator.org.eclipse.rdf4j.sail.memory.model.MemStatementIterator.StatsgetStats()protected voidhandleClose()Called byAbstractCloseableIteration.close()when it is called for the first time.inthashCode()StringtoString()-
Methods inherited from class org.eclipse.rdf4j.common.iteration.LookAheadIteration
hasNext, next, remove
-
Methods inherited from class org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration
close, isClosed
-
-
-
-
Constructor Detail
-
MemStatementIterator
public MemStatementIterator(MemStatementList statementList, MemResource subject, MemIRI predicate, MemValue object, Boolean explicit, int snapshot, MemResource... contexts)
Creates a new MemStatementIterator that will iterate over the statements contained in the supplied MemStatementList searching for statements that match the specified pattern of subject, predicate, object and context(s).- Parameters:
statementList- the statements over which to iterate.subject- subject of pattern.predicate- predicate of pattern.object- object of pattern.contexts- context(s) of pattern.
-
-
Method Detail
-
cacheAwareInstance
public static CloseableIteration<MemStatement,SailException> cacheAwareInstance(MemStatementList smallestList, MemResource subj, MemIRI pred, MemValue obj, Boolean explicit, int snapshot, MemResource[] memContexts, MemStatementIteratorCache iteratorCache)
-
getNextElement
protected MemStatement getNextElement()
Searches through statementList, starting from index _nextStatementIdx + 1, for statements that match the constraints that have been set for this iterator. If a matching statement has been found it will be stored in _nextStatement and _nextStatementIdx points to the index of this statement in _statementList. Otherwise, _nextStatement will set to null.- Specified by:
getNextElementin classLookAheadIteration<MemStatement,X extends Exception>- Returns:
- The next element, or null if no more elements are available.
-
handleClose
protected void handleClose() throws X extends ExceptionDescription copied from class:AbstractCloseableIterationCalled byAbstractCloseableIteration.close()when it is called for the first time. This method is only called once on each iteration. By default, this method does nothing.- Overrides:
handleClosein classLookAheadIteration<MemStatement,X extends Exception>- Throws:
XX extends Exception
-
getStats
public org.eclipse.rdf4j.sail.memory.model.MemStatementIterator.Stats getStats()
-
-