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

java.lang.Object
  extended by org.gcube.contentmanagement.contentmanager.stubs.model.predicates.AnyPredicate
All Implemented Interfaces:
java.io.Serializable, Predicate

public class AnyPredicate
extends java.lang.Object
implements Predicate

The 'null' predicate, it asserts nothing.

Author:
Fabio Simeoni (University of Strathclyde)
See Also:
Serialized Form

Constructor Summary
AnyPredicate()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 int hashCode()
          
 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.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnyPredicate

public AnyPredicate()
Method Detail

matches

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

Specified by:
matches in interface Predicate
Parameters:
n - the node.
Returns:
true if it does, false otherwise.

prune

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

Specified by:
prune in interface Predicate
Parameters:
n - the node.
Throws:
java.lang.Exception - if the node does not match the predicate.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object