org.rubato.logeo.predicates
Class ExtensionPredicate

java.lang.Object
  extended by org.rubato.logeo.predicates.AbstractPredicate
      extended by org.rubato.logeo.predicates.ExtensionPredicate
All Implemented Interfaces:
java.util.Comparator<Predicate>, Predicate

public class ExtensionPredicate
extends AbstractPredicate

A predicate defined by its extension.

Author:
Gérard Milmeister

Constructor Summary
ExtensionPredicate(Denotator... denotators)
          Creates a predicate with extension defined by denotators.
ExtensionPredicate(java.util.List<Denotator> denoList)
          Creates a predicate with extension defined by a list of denotators.
ExtensionPredicate(ListDenotator d)
          Creates a predicate with extension defined by the set of denotators in the ListDenotator d.
ExtensionPredicate(PowerDenotator d)
          Creates a predicate with extension defined by the set of denotators in the PowerDenotator d.
 
Method Summary
 ExtensionPredicate add(Denotator... denotators)
          Adds denotators to the extension.
 ExtensionPredicate addAll(ListDenotator d)
          Adds all coordinate denotators from d to the extension.
 ExtensionPredicate addAll(PowerDenotator d)
          Adds all coordinate denotators from d to the extension.
 boolean call(Denotator... denotators)
          Calls the predicate with a list of arguments.
 int getArity()
          Returns the arity of the predicate.
 Form getInputForm(int i)
          Returns the ith argument form.
 
Methods inherited from class org.rubato.logeo.predicates.AbstractPredicate
and, compare, getName, isCompatible, negated, or, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ExtensionPredicate

public ExtensionPredicate(java.util.List<Denotator> denoList)
Creates a predicate with extension defined by a list of denotators.


ExtensionPredicate

public ExtensionPredicate(Denotator... denotators)
Creates a predicate with extension defined by denotators.


ExtensionPredicate

public ExtensionPredicate(PowerDenotator d)
Creates a predicate with extension defined by the set of denotators in the PowerDenotator d.


ExtensionPredicate

public ExtensionPredicate(ListDenotator d)
Creates a predicate with extension defined by the set of denotators in the ListDenotator d.

Method Detail

call

public boolean call(Denotator... denotators)
Description copied from class: AbstractPredicate
Calls the predicate with a list of arguments. The predicate must have arity equal to the length of the list.

Specified by:
call in interface Predicate
Specified by:
call in class AbstractPredicate

getArity

public int getArity()
Description copied from class: AbstractPredicate
Returns the arity of the predicate. Must be implemented in a subclass.

Specified by:
getArity in interface Predicate
Specified by:
getArity in class AbstractPredicate

getInputForm

public Form getInputForm(int i)
Description copied from class: AbstractPredicate
Returns the ith argument form. Must be implemented in a subclass.

Specified by:
getInputForm in interface Predicate
Specified by:
getInputForm in class AbstractPredicate

addAll

public ExtensionPredicate addAll(PowerDenotator d)
Adds all coordinate denotators from d to the extension.

Parameters:
d - a PowerDenotator

addAll

public ExtensionPredicate addAll(ListDenotator d)
Adds all coordinate denotators from d to the extension.

Parameters:
d - a ListDenotator

add

public ExtensionPredicate add(Denotator... denotators)
Adds denotators to the extension.