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>
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
ConstructorDescriptionMemStatementIterator
(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
Modifier and TypeMethodDescriptioncacheAwareInstance
(MemStatementList smallestList, MemResource subj, MemIRI pred, MemValue obj, Boolean explicit, int snapshot, MemResource[] memContexts, MemStatementIteratorCache iteratorCache) boolean
protected MemStatement
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.Stats
getStats()
protected void
Called byAbstractCloseableIteration.close()
when it is called for the first time.int
hashCode()
toString()
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 Details
-
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 Details
-
cacheAwareInstance
public static CloseableIteration<MemStatement,SailException> cacheAwareInstance(MemStatementList smallestList, MemResource subj, MemIRI pred, MemValue obj, Boolean explicit, int snapshot, MemResource[] memContexts, MemStatementIteratorCache iteratorCache) -
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:
getNextElement
in classLookAheadIteration<MemStatement,
X extends Exception> - Returns:
- The next element, or null if no more elements are available.
-
handleClose
Description copied from class:AbstractCloseableIteration
Called 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:
handleClose
in classLookAheadIteration<MemStatement,
X extends Exception> - Throws:
X
-
equals
-
hashCode
public int hashCode() -
toString
-
getStats
public org.eclipse.rdf4j.sail.memory.model.MemStatementIterator.Stats getStats()
-