org.gcube.contentmanagement.contentmanager.stubs.model.predicates
Class Only
java.lang.Object
org.gcube.contentmanagement.contentmanager.stubs.model.predicates.EdgePredicate
org.gcube.contentmanagement.contentmanager.stubs.model.predicates.Only
- All Implemented Interfaces:
- java.io.Serializable
public class Only
- extends EdgePredicate
Asserts the existence of zero or more edges
that have a given label and target nodes that satisfy a given predicate.
- Author:
- Fabio Simeoni (University of Strathclyde)
- See Also:
- Serialized Form
Constructor Summary |
Only(javax.xml.namespace.QName l,
Predicate p)
Creates an instance for a givel label and predicate. |
Method Summary |
boolean |
matches(java.util.List<Edge> edges)
Indicates whether the predicate matches some of the edges in a given list. |
java.util.List<Edge> |
prune(java.util.List<Edge> edges)
Returns the edges from a given list which match the predicate. |
EdgePredicate.Range |
range()
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Only
public Only(javax.xml.namespace.QName l,
Predicate p)
- Creates an instance for a givel label and predicate.
- Parameters:
l
- the label.p
- the predicate.
matches
public boolean matches(java.util.List<Edge> edges)
- Indicates whether the predicate matches some of the edges in a given list.
- Parameters:
edges
- the list.
- Returns:
true
if it does, false
otherwise.
prune
public java.util.List<Edge> prune(java.util.List<Edge> edges)
throws java.lang.Exception
- Returns the edges from a given list which match the predicate.
- Parameters:
edges
- the list.
- Returns:
- the matching edges.
- Throws:
java.lang.Exception
- if an attempt to match an edge fails with an error.
range
public EdgePredicate.Range range()
-
- Specified by:
range
in class EdgePredicate