Class MemStatementList
- java.lang.Object
-
- org.eclipse.rdf4j.sail.memory.model.MemStatementList
-
public class MemStatementList extends Object
A dedicated data structure for storing MemStatement objects, offering operations optimized for their use in the memory Sail.
-
-
Constructor Summary
Constructors Constructor Description MemStatementList()
MemStatementList(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(MemStatement st)
void
cleanSnapshots(int currentSnapshot)
void
clear()
MemStatement
getExact(MemResource subject, MemIRI predicate, MemValue object, MemResource context, int snapshot)
Iterates through this list and returns the statement that exactly matches the provided arguments.int
getGuaranteedLastIndexInUse()
MemStatement[]
getStatements()
An internal method to retrieve the inner array that stores the statements.boolean
isEmpty()
boolean
optimisticRemove(MemStatement st)
boolean
optimisticRemove(MemStatement st, int index)
void
setPrioritiseCleanup(boolean prioritiseCleanup)
int
size()
-
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
add
public void add(MemStatement st) throws InterruptedException
- Throws:
InterruptedException
-
optimisticRemove
public boolean optimisticRemove(MemStatement st) throws InterruptedException
- Throws:
InterruptedException
-
optimisticRemove
public boolean optimisticRemove(MemStatement st, int index) throws InterruptedException
- Throws:
InterruptedException
-
clear
public void clear()
-
cleanSnapshots
public void cleanSnapshots(int currentSnapshot) throws InterruptedException
- Throws:
InterruptedException
-
getExact
public MemStatement getExact(MemResource subject, MemIRI predicate, MemValue object, MemResource context, int snapshot) throws InterruptedException
Iterates through this list and returns the statement that exactly matches the provided arguments. The subject, predicate and object should not be null. If the context is null it will match statements with null as their context.- Parameters:
subject
-predicate
-object
-context
-snapshot
-- Returns:
- Throws:
InterruptedException
-
getStatements
public MemStatement[] getStatements() throws InterruptedException
An internal method to retrieve the inner array that stores the statements. Useful to reduce the number of volatile reads.- Returns:
- the underlying array og MemStatements
- Throws:
InterruptedException
-
getGuaranteedLastIndexInUse
public int getGuaranteedLastIndexInUse()
-
setPrioritiseCleanup
public void setPrioritiseCleanup(boolean prioritiseCleanup)
-
-