Package org.eclipse.rdf4j.model.impl
Class FilteredModel
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<Statement>
-
- org.eclipse.rdf4j.model.impl.AbstractModel
-
- org.eclipse.rdf4j.model.impl.FilteredModel
-
- All Implemented Interfaces:
Serializable
,Iterable<Statement>
,Collection<Statement>
,Set<Statement>
,Model
,NamespaceAware
public abstract class FilteredModel extends AbstractModel
Applies a basic graph pattern filter to what triples can be see.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FilteredModel(AbstractModel model, Resource subj, IRI pred, Value obj, Resource... contexts)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
add(Resource s, IRI p, Value o, Resource... c)
boolean
contains(Resource s, IRI p, Value o, Resource... c)
Model
filter(Resource s, IRI p, Value o, Resource... c)
Optional<Namespace>
getNamespace(String prefix)
Set<Namespace>
getNamespaces()
boolean
remove(Resource s, IRI p, Value o, Resource... c)
protected abstract void
removeFilteredTermIteration(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.Optional<Namespace>
removeNamespace(String prefix)
void
removeTermIteration(Iterator<Statement> iter, Resource s, IRI p, Value o, Resource... c)
Called by aggregate sets when a term has been removed from a term iterator.Namespace
setNamespace(String prefix, String name)
void
setNamespace(Namespace namespace)
int
size()
-
Methods inherited from class org.eclipse.rdf4j.model.impl.AbstractModel
add, addAll, clear, clear, closeIterator, contains, containsAll, contexts, isEmpty, objects, predicates, remove, removeAll, retainAll, subjects, toArray, toArray, unmodifiable
-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
iterator, 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
getStatements
-
Methods inherited from interface java.util.Set
equals, hashCode, iterator, spliterator
-
-
-
-
Constructor Detail
-
FilteredModel
protected FilteredModel(AbstractModel model, Resource subj, IRI pred, Value obj, Resource... contexts)
-
-
Method Detail
-
setNamespace
public void setNamespace(Namespace namespace)
-
size
public int size()
- Specified by:
size
in interfaceCollection<Statement>
- Specified by:
size
in interfaceSet<Statement>
- Specified by:
size
in classAbstractCollection<Statement>
-
removeTermIteration
public final void removeTermIteration(Iterator<Statement> iter, Resource s, IRI p, Value o, Resource... c)
Description copied from class:AbstractModel
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.- Specified by:
removeTermIteration
in classAbstractModel
- Parameters:
iter
- The iterator used to navigate the live set (never null)s
- the subject term to be removed or nullp
- the predicate term to be removed or nullo
- the object term to be removed or nullc
- an array of one context term to be removed or an empty array
-
removeFilteredTermIteration
protected abstract void removeFilteredTermIteration(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. At least 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
-
-