public class LinkedHashModel extends AbstractModel
Model interface.
This implementation provides constant-time performance for filters using a single term, assuming the hash function
disperses the elements properly among the buckets. Each term is indexed using a HashMap. When multiple terms
are provided in a filter the index, of the term that reduces the possible Statements the most, is used and a
sequential scan is used to filter additional terms.
Note that this implementation is not synchronized. If multiple threads access a model concurrently, and at least one of the threads modifies the model, it must be synchronized externally. This is typically accomplished by synchronizing on some object that naturally encapsulates the model. If no such object exists, the set should be "wrapped" using the * Models.synchronizedModel method.
| Modifier and Type | Class and Description |
|---|---|
static class |
LinkedHashModel.ModelStatement |
| Constructor and Description |
|---|
LinkedHashModel() |
LinkedHashModel(Collection<? extends Statement> c) |
LinkedHashModel(int size) |
LinkedHashModel(Model model) |
LinkedHashModel(Set<Namespace> namespaces) |
LinkedHashModel(Set<Namespace> namespaces,
Collection<? extends Statement> c) |
LinkedHashModel(Set<Namespace> namespaces,
int size) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Resource subj,
IRI pred,
Value obj,
Resource... contexts) |
boolean |
add(Statement statement) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
contains(Resource subj,
IRI pred,
Value obj,
Resource... contexts) |
Model |
filter(Resource subj,
IRI pred,
Value obj,
Resource... contexts) |
Optional<Namespace> |
getNamespace(String prefix) |
Set<Namespace> |
getNamespaces() |
boolean |
isEmpty() |
Iterator |
iterator() |
boolean |
remove(Resource subj,
IRI pred,
Value obj,
Resource... contexts) |
Optional<Namespace> |
removeNamespace(String prefix) |
void |
removeTermIteration(Iterator iterator,
Resource subj,
IRI pred,
Value obj,
Resource... contexts)
Called by aggregate sets when a term has been removed from a term iterator.
|
void |
setNamespace(Namespace namespace) |
Namespace |
setNamespace(String prefix,
String name) |
int |
size() |
addAll, clear, closeIterator, containsAll, contexts, objects, predicates, remove, removeAll, retainAll, subjects, toArray, toArray, unmodifiableequals, hashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, contains, filter, getStatements, removeequals, hashCode, spliteratorparallelStream, removeIf, streampublic LinkedHashModel()
public LinkedHashModel(Model model)
public LinkedHashModel(Collection<? extends Statement> c)
public LinkedHashModel(int size)
public LinkedHashModel(Set<Namespace> namespaces, Collection<? extends Statement> c)
public void setNamespace(Namespace namespace)
public int size()
size in interface Collection<Statement>size in interface Set<Statement>size in class AbstractCollection<Statement>public boolean add(Statement statement)
add in interface Collection<Statement>add in interface Set<Statement>add in class AbstractModelpublic void clear()
clear in interface Collection<Statement>clear in interface Set<Statement>clear in class AbstractModelpublic boolean contains(Object o)
contains in interface Collection<Statement>contains in interface Set<Statement>contains in class AbstractModelpublic Iterator iterator()
public void removeTermIteration(Iterator iterator, Resource subj, IRI pred, Value obj, Resource... contexts)
AbstractModelremoveTermIteration in class AbstractModeliterator - The iterator used to navigate the live set (never null)subj - the subject term to be removed or nullpred - the predicate term to be removed or nullobj - the object term to be removed or nullcontexts - an array of one context term to be removed or an empty arraypublic boolean isEmpty()
isEmpty in interface Collection<Statement>isEmpty in interface Set<Statement>isEmpty in class AbstractModelCopyright © 2015-2021 Eclipse Foundation. All Rights Reserved.