Package org.eclipse.rdf4j.model.impl
Class AbstractModel
- All Implemented Interfaces:
Serializable,Iterable<Statement>,Collection<Statement>,Set<Statement>,Model,NamespaceAware
- Direct Known Subclasses:
AbstractMemoryOverflowModel,EmptyModel,FilteredModel,LinkedHashModel,SailModel,TreeModel
Provides basic operations that are common to all Models.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends Statement> c) voidclear()booleanRemoves statements with the specified context exist in this model.protected voidcloseIterator(Iterator<?> iter) Cleans up any resources used by this iterator.booleanbooleancontainsAll(Collection<?> c) contexts()Returns aSetview of the contexts contained in this model.booleanisEmpty()objects()Returns aSetview of the objects contained in this model.Returns aSetview of the predicates contained in this model.booleanbooleanremoveAll(Collection<?> c) abstract voidremoveTermIteration(Iterator<Statement> iter, Resource subj, IRI pred, Value obj, Resource... contexts) Called by aggregate sets when a term has been removed from a term iterator.booleanretainAll(Collection<?> c) subjects()Returns aSetview of the subjects contained in this model.Object[]toArray()<T> T[]toArray(T[] a) Returns an unmodifiable view of this model.Methods inherited from class java.util.AbstractSet
equals, hashCodeMethods inherited from class java.util.AbstractCollection
iterator, size, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.eclipse.rdf4j.model.Model
add, contains, filter, getStatements, remove, removeNamespace, setNamespace, setNamespaceMethods inherited from interface org.eclipse.rdf4j.model.NamespaceAware
getNamespace, getNamespaces
-
Field Details
-
NULL_CONTEXT
-
-
Constructor Details
-
AbstractModel
public AbstractModel()
-
-
Method Details
-
unmodifiable
Description copied from interface:ModelReturns an unmodifiable view of this model. This method provides "read-only" access to this model. Query operations on the returned model "read through" to this model, and attempts to modify the returned model, whether direct or via its iterator, result in anUnsupportedOperationException.- Specified by:
unmodifiablein interfaceModel- Returns:
- an unmodifiable view of the specified set.
-
add
- Specified by:
addin interfaceCollection<Statement>- Specified by:
addin interfaceSet<Statement>- Overrides:
addin classAbstractCollection<Statement>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Statement>- Specified by:
isEmptyin interfaceSet<Statement>- Overrides:
isEmptyin classAbstractCollection<Statement>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Statement>- Specified by:
containsAllin interfaceSet<Statement>- Overrides:
containsAllin classAbstractCollection<Statement>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Statement>- Specified by:
removeAllin interfaceSet<Statement>- Overrides:
removeAllin classAbstractSet<Statement>
-
toArray
- Specified by:
toArrayin interfaceCollection<Statement>- Specified by:
toArrayin interfaceSet<Statement>- Overrides:
toArrayin classAbstractCollection<Statement>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<Statement>- Specified by:
toArrayin interfaceSet<Statement>- Overrides:
toArrayin classAbstractCollection<Statement>
-
addAll
- Specified by:
addAllin interfaceCollection<Statement>- Specified by:
addAllin interfaceSet<Statement>- Overrides:
addAllin classAbstractCollection<Statement>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Statement>- Specified by:
retainAllin interfaceSet<Statement>- Overrides:
retainAllin classAbstractCollection<Statement>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Statement>- Specified by:
clearin interfaceSet<Statement>- Overrides:
clearin classAbstractCollection<Statement>
-
clear
Description copied from interface:ModelRemoves statements with the specified context exist in this model. -
remove
- Specified by:
removein interfaceCollection<Statement>- Specified by:
removein interfaceSet<Statement>- Overrides:
removein classAbstractCollection<Statement>
-
contains
- Specified by:
containsin interfaceCollection<Statement>- Specified by:
containsin interfaceSet<Statement>- Overrides:
containsin classAbstractCollection<Statement>
-
subjects
Description copied from interface:ModelReturns aSetview of the subjects contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is a subject value, via theIterator.remove,Set.remove,removeAll,retainAll, andclearoperations. It does not support theaddoraddAlloperations if the parameterspredorobjare null. -
predicates
Description copied from interface:ModelReturns aSetview of the predicates contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is a predicate value, via theIterator.remove,Set.remove,removeAll,retainAll, andclearoperations. It does not support theaddoraddAlloperations if the parameterssubjorobjare null.- Specified by:
predicatesin interfaceModel- Returns:
- a set view of the predicates contained in this model
-
objects
Description copied from interface:ModelReturns aSetview of the objects contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is an object value, via theIterator.remove,Set.remove,removeAll,retainAll, andclearoperations. It does not support theaddoraddAlloperations if the parameterssubjorpredare null. -
contexts
Description copied from interface:ModelReturns aSetview of the contexts contained in this model. The set is backed by the model, so changes to the model are reflected in the set, and vice-versa. If the model is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined. The set supports element removal, which removes all statements from the model for which that element is a context value, via theIterator.remove,Set.remove,removeAll,retainAll, andclearoperations. It does not support theaddoraddAlloperations if the parameterssubj,predorobjare null. -
removeTermIteration
public abstract void removeTermIteration(Iterator<Statement> iter, Resource subj, IRI pred, Value obj, Resource... contexts) Called by aggregate sets when a term has been removed from a term iterator. Exactly one of the last four terms will be non-empty.- Parameters:
iter- 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 array
-
closeIterator
Cleans up any resources used by this iterator. After this call the given iterator should not be used.- Parameters:
iter- Iterator to clean up
-