org.rubato.logeo.predicates
Interface Predicate

All Superinterfaces:
java.util.Comparator<Predicate>
All Known Implementing Classes:
AbstractPredicate, ExtensionPredicate, FormPredicate

public interface Predicate
extends java.util.Comparator<Predicate>

This is the general interface for predicates with an arbitrary number of arguments. Arguments are always denotators. To implement a predicate, extend the AbstractPredicate class.

Author:
Gérard Milmeister

Method Summary
 Predicate and(Predicate p)
          Returns a predicate that is the conjuction of this and p.
 boolean call(Denotator... denotators)
          Calls the predicate with one argument.
 int getArity()
          Returns the arity of the predicate.
 Form getInputForm(int i)
          Returns the ith argument form.
 java.lang.String getName()
          Returns the name of the predicate.
 boolean isCompatible(Predicate p)
          Returns true if p is compatible to this.
 Predicate negated()
          Returns a predicate that is the negation of this.
 Predicate or(Predicate p)
          Returns a predicate that is the disjunction of this and p.
 
Methods inherited from interface java.util.Comparator
compare, equals
 

Method Detail

call

boolean call(Denotator... denotators)
             throws RubatoException
Calls the predicate with one argument. The predicate must have arity = 1.

Throws:
RubatoException

and

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

Throws:
RubatoException

or

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

Throws:
RubatoException

negated

Predicate negated()
Returns a predicate that is the negation of this.


getArity

int getArity()
Returns the arity of the predicate.


getInputForm

Form getInputForm(int i)
Returns the ith argument form.


getName

java.lang.String getName()
Returns the name of the predicate.


isCompatible

boolean isCompatible(Predicate p)
Returns true if p is compatible to this. Two predicates are compatible if both have the same arity and argument forms.