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 Details

    • MIN_SIZE_TO_CONSIDER_FOR_CACHE

      public static final int MIN_SIZE_TO_CONSIDER_FOR_CACHE
      See Also:
    • statementListSize

      private final int statementListSize
      The lists of statements over which to iterate, and its size (different from length). Always set the size before the array. If we get the array first and the size after, then the MemStatementList object could have resized the array in between so that the size > length.
    • statementList

      private MemStatement[] statementList
    • 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.
    • contexts

      private final MemResource[] contexts
      The context of statements to return, or null if any context is OK.
    • explicit

      private final boolean explicit
      Flag indicating whether this iterator should only return explicitly added statements or only return inferred statements.

      If this has not been specified (null) and we should return both explicit and inferred statements, then the flag below will be set to true.

    • explicitNotSpecified

      private final boolean explicitNotSpecified
    • snapshot

      private final int snapshot
      Indicates which snapshot should be iterated over.
    • noIsolation

      private final boolean noIsolation
    • statementIndex

      private int statementIndex
      The index of the last statement that has been returned.
    • matchingStatements

      private int matchingStatements
      The number of returned statements
    • nextElement

      private MemStatement nextElement
    • closed

      private boolean closed
      Flag indicating whether this iteration has been closed.
    • iteratorCache

      private final MemStatementIteratorCache iteratorCache
    • cachedHashCode

      private int cachedHashCode
  • Constructor Details

    • 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 Details