Class logic.Condition
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class logic.Condition

Object
   |
   +----logic.Condition

public class Condition
extends Object
This class abstracts the notion of a "condition" in branching logic. It provides constructors for a variety of simple kinds of conditions such as comparing primitives with =, <, or <=. It also provides a constructor for testing whether objects are equal, and a more general constructor, which accepts a Hashtable, for more complicated conditions.


Variable Index

 o EQUAL
 o LESS
 o LESS_EQUAL

Constructor Index

 o logic.Condition(int, int, int)
This constructor compares two int's using the comparison named by oper.
 o logic.Condition(float, int, float)
This constructor compares two float's using the comparison named by oper.
 o logic.Condition(double, int, double)
This constructor compares two doubles using the comparison named by oper.
 o logic.Condition(boolean, boolean)
This constructor compares two booleans to see if they are the same.
 o logic.Condition(Hashtable)
This version of Condition accepts a Hashtable that must contain all the data that is necessary to implement the evaluate() method -- the evaluate() method must be overridden if this constructor is used.
 o logic.Condition(Object, Object)
This constructor is used when two objects need to be compared.

Method Index

 o evaluate()
If the Hashtable version of the constructor is used, this method must be overridden; otherwise the present version of evaluate should work without modification
 o getData()
 o toString()

Variables

 o EQUAL
public static final int EQUAL
 o LESS
public static final int LESS
 o LESS_EQUAL
public static final int LESS_EQUAL

Constructors

 o Condition
public Condition(int i1,
                 int oper,
                 int i2) throws IllegalExpressionException
This constructor compares two int's using the comparison named by oper. The default evaluate() method should be used.

 o Condition
public Condition(float f1,
                 int oper,
                 float f2) throws IllegalExpressionException
This constructor compares two float's using the comparison named by oper. The default evaluate() method should be used.

 o Condition
public Condition(double d1,
                 int oper,
                 double d2) throws IllegalExpressionException
This constructor compares two doubles using the comparison named by oper. The default evaluate() method should be used.

 o Condition
public Condition(boolean b1,
                 boolean b2)
This constructor compares two booleans to see if they are the same. The default evaluate() method should be used.

 o Condition
public Condition(Hashtable data)
This version of Condition accepts a Hashtable that must contain all the data that is necessary to implement the evaluate() method -- the evaluate() method must be overridden if this constructor is used.

 o Condition
public Condition(Object ob1,
                 Object ob2)
This constructor is used when two objects need to be compared. Usually, the default equals(Object) method provided by Object should be overridden in the class that is the template for the arguments ob1 and ob2.

Methods

 o evaluate
public java.lang.Boolean evaluate() throws DataNotFoundException
If the Hashtable version of the constructor is used, this method must be overridden; otherwise the present version of evaluate should work without modification

 o getData
public java.util.Hashtable getData()
 o toString
public java.lang.String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index