public class TreeModel extends AbstractModel implements SortedSet<Statement>
Model implementation. The model is sorted according to the lexical ordering of terms.
This implementation provides guaranteed log(n) time cost for filtered access by any number of terms. If an index is
not yet available for a set of positions, it is created at runtime using a TreeSet.
Note that this implementation is not synchronized. If multiple threads access a model concurrently, even if all of them are read operations, 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.
| Constructor and Description |
|---|
TreeModel() |
TreeModel(Collection<? extends Statement> c) |
TreeModel(Model model) |
TreeModel(Set<Namespace> namespaces) |
TreeModel(Set<Namespace> namespaces,
Collection<? extends Statement> c) |
add, addAll, clear, closeIterator, contains, containsAll, contexts, objects, predicates, remove, removeAll, retainAll, subjects, toArray, toArray, unmodifiableequals, hashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitspliteratoradd, addAll, contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArrayparallelStream, removeIf, streampublic TreeModel()
public TreeModel(Model model)
public TreeModel(Collection<? extends Statement> c)
public TreeModel(Set<Namespace> namespaces, Collection<? extends Statement> c)
public Optional<Namespace> getNamespace(String prefix)
getNamespace in interface NamespaceAwarepublic Set<Namespace> getNamespaces()
getNamespaces in interface NamespaceAwarepublic Namespace setNamespace(String prefix, String name)
setNamespace in interface Modelpublic void setNamespace(Namespace namespace)
setNamespace in interface Modelpublic Optional<Namespace> removeNamespace(String prefix)
removeNamespace in interface Modelpublic int size()
size in interface Collection<Statement>size in interface Set<Statement>size in class AbstractCollection<Statement>public void clear()
clear in interface Collection<Statement>clear in interface Set<Statement>clear in class AbstractModelpublic Comparator<? super Statement> comparator()
comparator in interface SortedSet<Statement>public Statement pollFirst()
public Statement pollLast()
public void removeTermIteration(Iterator<Statement> 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.