org.qedeq.kernel.bo.logic.model
Class Predicate

java.lang.Object
  extended by org.qedeq.kernel.bo.logic.model.Predicate

public abstract class Predicate
extends java.lang.Object

One predicate for our model.

Author:
Michael Meyling

Constructor Summary
Predicate(int minimum, int maximum, java.lang.String display, java.lang.String description)
          Constructor.
 
Method Summary
static Predicate and(Predicate op1, Predicate op2)
          Construct conjunction of two predicates.
abstract  boolean calculate(Entity[] entities)
          Calculate truth value.
 java.lang.String getDescription()
          Get description.
 int getMaximumArgumentNumber()
          Get maximum number of arguments this predicate has.
 int getMinimumArgumentNumber()
          Get minimum number of arguments this predicate has.
static Predicate isEntity(Entity entity)
          Construct identifying predicate.
static Predicate not(Predicate predicate)
          Construct negation of other predicate.
static Predicate or(Predicate op1, Predicate op2)
          Construct disjunction of two predicates.
 java.lang.String toString()
          Get display text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Predicate

public Predicate(int minimum,
                 int maximum,
                 java.lang.String display,
                 java.lang.String description)
Constructor.

Parameters:
minimum - Minimum number of arguments this predicate has.
maximum - Maximum number of arguments this predicate has.
display - Show this to represent the predicate within outputs.
description - Description for this predicate.
Method Detail

not

public static Predicate not(Predicate predicate)
Construct negation of other predicate.

Parameters:
predicate - Negate this predicate.
Returns:
Negation of predicate.

and

public static Predicate and(Predicate op1,
                            Predicate op2)
Construct conjunction of two predicates.

Parameters:
op1 - First predicate.
op2 - Second predicate.
Returns:
Conjunction of two predicates.

or

public static Predicate or(Predicate op1,
                           Predicate op2)
Construct disjunction of two predicates.

Parameters:
op1 - First predicate.
op2 - Second predicate.
Returns:
Disjunction of two predicates.

isEntity

public static Predicate isEntity(Entity entity)
Construct identifying predicate.

Parameters:
entity - Check if all entities are equal to this.
Returns:
Predicate to check for this entity.

getMinimumArgumentNumber

public int getMinimumArgumentNumber()
Get minimum number of arguments this predicate has.

Returns:
Minimum number of arguments for this predicate.

getMaximumArgumentNumber

public int getMaximumArgumentNumber()
Get maximum number of arguments this predicate has.

Returns:
Maximum umber of arguments for this predicate.

toString

public java.lang.String toString()
Get display text.

Overrides:
toString in class java.lang.Object
Returns:
Representation of this predicate for textual output.

getDescription

public java.lang.String getDescription()
Get description.

Returns:
Description of this predicate.

calculate

public abstract boolean calculate(Entity[] entities)
Calculate truth value.

Parameters:
entities - Calculate predicate for this entities.
Returns:
Truth value.


Copyright © 2014. All Rights Reserved.