Package org.eclipse.rdf4j.model.impl
Class AbstractModel
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<Statement>
-
- org.eclipse.rdf4j.model.impl.AbstractModel
-
- All Implemented Interfaces:
Serializable,Iterable<Statement>,Collection<Statement>,Set<Statement>,Model,NamespaceAware
- Direct Known Subclasses:
EmptyModel,FilteredModel,LinkedHashModel,TreeModel
public abstract class AbstractModel extends AbstractSet<Statement> implements Model
Provides basic operations that are common to all Models.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractModel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanadd(Statement st)booleanaddAll(Collection<? extends Statement> c)voidclear()booleanclear(Resource... contexts)protected voidcloseIterator(Iterator<?> iter)Cleans up any resources used by this iterator.booleancontains(Object o)booleancontainsAll(Collection<?> c)Set<Resource>contexts()booleanisEmpty()Set<Value>objects()Set<IRI>predicates()booleanremove(Object o)booleanremoveAll(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)Set<Resource>subjects()Object[]toArray()<T> T[]toArray(T[] a)Modelunmodifiable()-
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
-
-
-
-
Method Detail
-
unmodifiable
public Model unmodifiable()
- Specified by:
unmodifiablein interfaceModel
-
add
public boolean add(Statement st)
- 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
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<Statement>- Specified by:
containsAllin interfaceSet<Statement>- Overrides:
containsAllin classAbstractCollection<Statement>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Statement>- Specified by:
removeAllin interfaceSet<Statement>- Overrides:
removeAllin classAbstractSet<Statement>
-
toArray
public Object[] 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
public boolean addAll(Collection<? extends Statement> c)
- Specified by:
addAllin interfaceCollection<Statement>- Specified by:
addAllin interfaceSet<Statement>- Overrides:
addAllin classAbstractCollection<Statement>
-
retainAll
public boolean retainAll(Collection<?> c)
- 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>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<Statement>- Specified by:
removein interfaceSet<Statement>- Overrides:
removein classAbstractCollection<Statement>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<Statement>- Specified by:
containsin interfaceSet<Statement>- Overrides:
containsin classAbstractCollection<Statement>
-
predicates
public Set<IRI> predicates()
- Specified by:
predicatesin interfaceModel
-
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
protected void closeIterator(Iterator<?> iter)
Cleans up any resources used by this iterator. After this call the given iterator should not be used.- Parameters:
iter- Iterator to clean up
-
-