org.rubato.logeo.predicates
Class Predicates

java.lang.Object
  extended by org.rubato.logeo.predicates.Predicates

public final class Predicates
extends java.lang.Object

Several functions used for combining predicates.

Author:
Gérard Milmeister

Constructor Summary
Predicates()
           
 
Method Summary
static Predicate and(Predicate p, Predicate q)
          Returns a predicate that is the conjuction of p and q.
static Predicate fromFunction(Function f)
          Returns a predicate based on a function that returns a denotator of form "Boolean".
static Predicate getTruePredicate()
          Returns a predicate of arity 1 that is always true.
static Predicate getTruePredicate(int n)
          Returns a predicate of arity n that is always true.
static Predicate not(Predicate p)
          Returns a predicate that is the negation of p.
static Predicate or(Predicate p, Predicate q)
          Returns a predicate that is the disjunction of p and p.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Predicates

public Predicates()
Method Detail

and

public static Predicate and(Predicate p,
                            Predicate q)
                     throws RubatoException
Returns a predicate that is the conjuction of p and q. Both predicates must have same arity.

Throws:
RubatoException

or

public static Predicate or(Predicate p,
                           Predicate q)
                    throws RubatoException
Returns a predicate that is the disjunction of p and p. Both predicates must have same arity.

Throws:
RubatoException

not

public static Predicate not(Predicate p)
Returns a predicate that is the negation of p.


getTruePredicate

public static Predicate getTruePredicate()
Returns a predicate of arity 1 that is always true.


getTruePredicate

public static Predicate getTruePredicate(int n)
Returns a predicate of arity n that is always true.


fromFunction

public static Predicate fromFunction(Function f)
Returns a predicate based on a function that returns a denotator of form "Boolean".