org.gcube.contentmanagement.contentmanager.stubs.model.predicates
Class CutTreePredicate
java.lang.Object
org.gcube.contentmanagement.contentmanager.stubs.model.predicates.TreePredicate
org.gcube.contentmanagement.contentmanager.stubs.model.predicates.CutTreePredicate
- All Implemented Interfaces:
- java.io.Serializable, Predicate
public class CutTreePredicate
- extends TreePredicate
A TreePredicate
in which prune(Node)
removes all the edges of matching nodes, not only those that are not required for matching.
This predicate can be used to minimise the amount of matching data returned by a prune(Node)
when the properties of the data are not
required for further processing (e.g. when matching elements need only to be counted). In particular, replacing pruning with matching is an optimisation.
- Author:
- Fabio Simeoni (University of Strathclyde)
- See Also:
- Serialized Form
Method Summary |
void |
prune(Node n)
Extends the behaviour of TreePredicate to removes all the edges of a nodes that matches the predicate, not only those that are not required for matching. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
CutTreePredicate
public CutTreePredicate(java.util.List<EdgePredicate> predicates)
- Creates and instance with a list of
EdgePredicate
s.
- Parameters:
predicates
- the predicates
prune
public void prune(Node n)
throws java.lang.Exception
- Extends the behaviour of
TreePredicate
to removes all the edges of a nodes that matches the predicate, not only those that are not required for matching.
- Specified by:
prune
in interface Predicate
- Overrides:
prune
in class TreePredicate
- Parameters:
n
- the node.
- Throws:
java.lang.Exception
- if the node does not match the predicate.
toString
public java.lang.String toString()
- Description copied from class:
TreePredicate
-
- Overrides:
toString
in class TreePredicate