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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends Statement> c) void
clear()
boolean
Removes statements with the specified context exist in this model.protected void
closeIterator
(Iterator<?> iter) Cleans up any resources used by this iterator.boolean
boolean
containsAll
(Collection<?> c) contexts()
Returns aSet
view of the contexts contained in this model.boolean
isEmpty()
objects()
Returns aSet
view of the objects contained in this model.Returns aSet
view of the predicates contained in this model.boolean
boolean
removeAll
(Collection<?> c) 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.boolean
retainAll
(Collection<?> c) subjects()
Returns aSet
view 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, hashCode
Methods inherited from class java.util.AbstractCollection
iterator, size, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface org.eclipse.rdf4j.model.Model
add, contains, filter, getStatements, remove, removeNamespace, setNamespace, setNamespace
Methods 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:Model
Returns 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:
unmodifiable
in interfaceModel
- Returns:
- an unmodifiable view of the specified set.
-
add
- Specified by:
add
in interfaceCollection<Statement>
- Specified by:
add
in interfaceSet<Statement>
- Overrides:
add
in classAbstractCollection<Statement>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<Statement>
- Specified by:
isEmpty
in interfaceSet<Statement>
- Overrides:
isEmpty
in classAbstractCollection<Statement>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<Statement>
- Specified by:
containsAll
in interfaceSet<Statement>
- Overrides:
containsAll
in classAbstractCollection<Statement>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<Statement>
- Specified by:
removeAll
in interfaceSet<Statement>
- Overrides:
removeAll
in classAbstractSet<Statement>
-
toArray
- Specified by:
toArray
in interfaceCollection<Statement>
- Specified by:
toArray
in interfaceSet<Statement>
- Overrides:
toArray
in classAbstractCollection<Statement>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<Statement>
- Specified by:
toArray
in interfaceSet<Statement>
- Overrides:
toArray
in classAbstractCollection<Statement>
-
addAll
- Specified by:
addAll
in interfaceCollection<Statement>
- Specified by:
addAll
in interfaceSet<Statement>
- Overrides:
addAll
in classAbstractCollection<Statement>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<Statement>
- Specified by:
retainAll
in interfaceSet<Statement>
- Overrides:
retainAll
in classAbstractCollection<Statement>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Statement>
- Specified by:
clear
in interfaceSet<Statement>
- Overrides:
clear
in classAbstractCollection<Statement>
-
clear
Description copied from interface:Model
Removes statements with the specified context exist in this model. -
remove
- Specified by:
remove
in interfaceCollection<Statement>
- Specified by:
remove
in interfaceSet<Statement>
- Overrides:
remove
in classAbstractCollection<Statement>
-
contains
- Specified by:
contains
in interfaceCollection<Statement>
- Specified by:
contains
in interfaceSet<Statement>
- Overrides:
contains
in classAbstractCollection<Statement>
-
subjects
Description copied from interface:Model
Returns aSet
view 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 ownremove
operation), 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
, andclear
operations. It does not support theadd
oraddAll
operations if the parameterspred
orobj
are null. -
predicates
Description copied from interface:Model
Returns aSet
view 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 ownremove
operation), 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
, andclear
operations. It does not support theadd
oraddAll
operations if the parameterssubj
orobj
are null.- Specified by:
predicates
in interfaceModel
- Returns:
- a set view of the predicates contained in this model
-
objects
Description copied from interface:Model
Returns aSet
view 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 ownremove
operation), 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
, andclear
operations. It does not support theadd
oraddAll
operations if the parameterssubj
orpred
are null. -
contexts
Description copied from interface:Model
Returns aSet
view 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 ownremove
operation), 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
, andclear
operations. It does not support theadd
oraddAll
operations if the parameterssubj
,pred
orobj
are 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
-