Class MemStatementIterator
- java.lang.Object
-
- org.eclipse.rdf4j.sail.memory.model.MemStatementIterator
-
- All Implemented Interfaces:
AutoCloseable
,CloseableIteration<MemStatement,SailException>
,Iteration<MemStatement,SailException>
public class MemStatementIterator extends Object implements CloseableIteration<MemStatement,SailException>
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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MIN_SIZE_TO_CONSIDER_FOR_CACHE
-
Constructor Summary
Constructors Constructor Description MemStatementIterator(MemStatementList statementList, MemResource subject, MemIRI predicate, MemValue object, Boolean explicit, int snapshot, MemStatementIteratorCache iteratorCache, 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)
void
close()
Closes this iteration, freeing any resources that it is holding.boolean
equals(Object o)
org.eclipse.rdf4j.sail.memory.model.MemStatementIterator.Stats
getStats()
int
hashCode()
boolean
hasNext()
Returns true if the iteration has more elements.MemStatement
next()
Returns the next element in the iteration.void
remove()
Throws anUnsupportedOperationException
.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration
stream
-
-
-
-
Field Detail
-
MIN_SIZE_TO_CONSIDER_FOR_CACHE
public static final int MIN_SIZE_TO_CONSIDER_FOR_CACHE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MemStatementIterator
public MemStatementIterator(MemStatementList statementList, MemResource subject, MemIRI predicate, MemValue object, Boolean explicit, int snapshot, MemStatementIteratorCache iteratorCache, MemResource... contexts) throws InterruptedException
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.- Throws:
InterruptedException
-
-
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) throws InterruptedException
- Throws:
InterruptedException
-
getStats
public org.eclipse.rdf4j.sail.memory.model.MemStatementIterator.Stats getStats()
-
hasNext
public final boolean hasNext()
Description copied from interface:Iteration
Returns true if the iteration has more elements. (In other words, returns true ifIteration.next()
would return an element rather than throwing a NoSuchElementException.)- Specified by:
hasNext
in interfaceIteration<MemStatement,SailException>
- Returns:
- true if the iteration has more elements.
-
next
public final MemStatement next()
Description copied from interface:Iteration
Returns the next element in the iteration.- Specified by:
next
in interfaceIteration<MemStatement,SailException>
- Returns:
- the next element in the iteration.
-
remove
public void remove()
Throws anUnsupportedOperationException
.- Specified by:
remove
in interfaceIteration<MemStatement,SailException>
-
close
public final void close()
Description copied from interface:CloseableIteration
Closes this iteration, freeing any resources that it is holding. If the iteration has already been closed then invoking this method has no effect.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseableIteration<MemStatement,SailException>
-
-