org.gcube.contentmanagement.contentmanager.stubs.model.predicates
Class Many

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.model.predicates.EdgePredicate
      extended by org.gcube.contentmanagement.contentmanager.stubs.model.predicates.Many
All Implemented Interfaces:
java.io.Serializable

public class Many
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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gcube.contentmanagement.contentmanager.stubs.model.predicates.EdgePredicate
EdgePredicate.Range
 
Constructor Summary
Many(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 org.gcube.contentmanagement.contentmanager.stubs.model.predicates.EdgePredicate
equals, hashCode, isCondition, label, predicate, setAsCondition, setPredicate, toString, unsetAsCondition
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Many

public Many(javax.xml.namespace.QName l,
            Predicate p)
Creates an instance for a givel label and predicate.

Parameters:
l - the label.
p - the predicate.
Method Detail

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