public abstract class AbstractModel extends AbstractSet<Statement> implements Model
Constructor and Description |
---|
AbstractModel() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Statement st) |
boolean |
addAll(Collection<? extends Statement> c) |
void |
clear() |
boolean |
clear(Resource... contexts)
Removes statements with the specified context exist in this model.
|
protected void |
closeIterator(Iterator<?> iter)
Cleans up any resources used by this iterator.
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
Set<Resource> |
contexts()
Returns a
Set view of the contexts contained in this model. |
boolean |
equals(Object o) |
ValueFactory |
getValueFactory()
Deprecated.
|
int |
hashCode() |
boolean |
isEmpty() |
Iterator<Statement> |
match(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Deprecated.
|
Literal |
objectLiteral()
Utility method that casts the return value of
Model.objectValue() to a
Literal, or throws a ModelUtilException if that value is not a Literal. |
Resource |
objectResource()
Utility method that casts the return value of
Model.objectValue() to a
Resource, or throws a ModelUtilException if that value is not a Resource. |
Set<Value> |
objects()
Returns a
Set view of the objects contained in this model. |
String |
objectString()
Utility method that returns the string value of
Model.objectValue() . |
URI |
objectURI()
Utility method that casts the return value of
Model.objectValue() to a
URI, or throws a ModelUtilException if that value is not a URI. |
Value |
objectValue()
Gets the object of the statement(s).
|
Set<URI> |
predicates()
Returns a
Set view of the predicates contained in this model. |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
abstract void |
removeTermIteration(Iterator<Statement> iter,
Resource subj,
URI pred,
Value obj,
Resource... contexts)
Called by aggregate sets when a term has been removed from a term
iterator.
|
boolean |
retainAll(Collection<?> c) |
Set<Resource> |
subjects()
Returns a
Set view of the subjects contained in this model. |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
Model |
unmodifiable()
Returns an unmodifiable view of this model.
|
iterator, size, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, contains, filter, getNamespace, getNamespaces, remove, removeNamespace, setNamespace, setNamespace
iterator, size, spliterator
parallelStream, removeIf, stream
public Model unmodifiable()
Model
unmodifiable
in interface Model
public boolean add(Statement st)
add
in interface Collection<Statement>
add
in interface Set<Statement>
add
in class AbstractCollection<Statement>
public boolean isEmpty()
isEmpty
in interface Collection<Statement>
isEmpty
in interface Set<Statement>
isEmpty
in class AbstractCollection<Statement>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<Statement>
containsAll
in interface Set<Statement>
containsAll
in class AbstractCollection<Statement>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<Statement>
removeAll
in interface Set<Statement>
removeAll
in class AbstractSet<Statement>
public Object[] toArray()
toArray
in interface Collection<Statement>
toArray
in interface Set<Statement>
toArray
in class AbstractCollection<Statement>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<Statement>
toArray
in interface Set<Statement>
toArray
in class AbstractCollection<Statement>
public boolean addAll(Collection<? extends Statement> c)
addAll
in interface Collection<Statement>
addAll
in interface Set<Statement>
addAll
in class AbstractCollection<Statement>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<Statement>
retainAll
in interface Set<Statement>
retainAll
in class AbstractCollection<Statement>
public void clear()
clear
in interface Collection<Statement>
clear
in interface Set<Statement>
clear
in class AbstractCollection<Statement>
public boolean clear(Resource... contexts)
Model
public boolean remove(Object o)
remove
in interface Collection<Statement>
remove
in interface Set<Statement>
remove
in class AbstractCollection<Statement>
public boolean contains(Object o)
contains
in interface Collection<Statement>
contains
in interface Set<Statement>
contains
in class AbstractCollection<Statement>
public Value objectValue() throws ModelException
Model
ModelException
is thrown if this is not the case.objectValue
in interface Model
ModelException
- If the statements matched by the specified parameters have more
than one unique object.public Literal objectLiteral() throws ModelException
Model
Model.objectValue()
to a
Literal, or throws a ModelUtilException if that value is not a Literal.objectLiteral
in interface Model
ModelException
- If such an exception is thrown by Model.objectValue()
or if its
return value is not a Literal.public Resource objectResource() throws ModelException
Model
Model.objectValue()
to a
Resource, or throws a ModelUtilException if that value is not a Resource.objectResource
in interface Model
ModelException
- If such an exception is thrown by Model.objectValue()
or if its
return value is not a Resource.public URI objectURI() throws ModelException
Model
Model.objectValue()
to a
URI, or throws a ModelUtilException if that value is not a URI.objectURI
in interface Model
ModelException
- If such an exception is thrown by Model.objectValue()
or if its
return value is not a URI.public String objectString() throws ModelException
Model
Model.objectValue()
.objectString
in interface Model
ModelException
- If the statements matched by the specified parameters have more
than one unique object.public int hashCode()
hashCode
in interface Collection<Statement>
hashCode
in interface Set<Statement>
hashCode
in class AbstractSet<Statement>
public boolean equals(Object o)
equals
in interface Collection<Statement>
equals
in interface Set<Statement>
equals
in class AbstractSet<Statement>
public Set<Resource> subjects()
Model
Set
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 own remove
operation), the results of the iteration are undefined. The set supports
element removal, which removes the corresponding statement from the model,
via the Iterator.remove, Set.remove, removeAll,
retainAll, and clear operations. It does not support the
add or addAll operations if the parameters pred
or obj are null.public Set<URI> predicates()
Model
Set
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 own remove
operation), the results of the iteration are undefined. The set supports
element removal, which removes the corresponding statement from the model,
via the Iterator.remove, Set.remove, removeAll,
retainAll, and clear operations. It does not support the
add or addAll operations if the parameters subj
or obj are null.predicates
in interface Model
public Set<Value> objects()
Model
Set
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 own remove
operation), the results of the iteration are undefined. The set supports
element removal, which removes the corresponding statement from the model,
via the Iterator.remove, Set.remove, removeAll,
retainAll, and clear operations. It does not support the
add or addAll operations if the parameters subj
or pred are null.public Set<Resource> contexts()
Model
Set
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 own remove
operation), the results of the iteration are undefined. The set supports
element removal, which removes the corresponding statement from the model,
via the Iterator.remove, Set.remove, removeAll,
retainAll, and clear operations. It does not support the
add or addAll operations if the parameters subj
, pred or obj are null.public abstract void removeTermIteration(Iterator<Statement> iter, Resource subj, URI pred, Value obj, Resource... contexts)
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 arrayprotected void closeIterator(Iterator<?> iter)
iter
- Iterator to clean up@Deprecated public Iterator<Statement> match(Resource subj, URI pred, Value obj, Resource... contexts)
Graph
Examples: graph.match(s1, null, null) matches all statements
that have subject s1,
graph.match(null, null, null, c1) matches all statements that
have context c1,
graph.match(null, null, null, (Resource)null) matches all
statements that have no associated context,
graph.match(null, null, null, c1, c2, c3) matches all
statements that have context c1, c2 or c3.
match
in interface Graph
subj
- The subject of the statements to match, null to match
statements with any subject.pred
- The predicate of the statements to match, null to match
statements with any predicate.obj
- The object of the statements to match, null to match
statements with any object.contexts
- The contexts of the statements to match. If no contexts are
specified, statements will match disregarding their context. If one
or more contexts are specified, statements with a context matching
one of these will match.@Deprecated public ValueFactory getValueFactory()
Graph
getValueFactory
in interface Graph
Copyright © 2001-2016 Aduna. All Rights Reserved.