org.gcube.contentmanagement.contentmanager.stubs.model.predicates
Interface Predicate

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AnyPredicate, Bool, Calendar, CutTreePredicate, Date, LeafPredicate, Num, RID, Text, TreePredicate

public interface Predicate
extends java.io.Serializable

A predicate on nodes of a gDoc document tree.

Author:
Fabio Simeoni (University of Strathclyde)

Method Summary
 boolean matches(Node n)
          Indicates whether a node matches a predicate.
 void prune(Node n)
          Prunes a node of all the descendants that are not required to match the predicate.
 

Method Detail

matches

boolean matches(Node n)
Indicates whether a node matches a predicate.

Parameters:
n - the node.
Returns:
true if it does, false otherwise.

prune

void prune(Node n)
           throws java.lang.Exception
Prunes a node of all the descendants that are not required to match the predicate.

Parameters:
n - the node.
Throws:
java.lang.Exception - if the node does not match the predicate.