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.
-
EQUAL
-
-
LESS
-
-
LESS_EQUAL
-
-
logic.Condition(int, int, int)
- This constructor compares two int's using the comparison named by oper.
-
logic.Condition(float, int, float)
- This constructor compares two float's using the comparison named by oper.
-
logic.Condition(double, int, double)
- This constructor compares two doubles using the comparison named by oper.
-
logic.Condition(boolean, boolean)
- This constructor compares two booleans to see if they are the same.
-
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.
-
logic.Condition(Object, Object)
- This constructor is used when two objects need to be compared.
-
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
-
getData()
-
-
toString()
-
EQUAL
public static final int EQUAL
LESS
public static final int LESS
LESS_EQUAL
public static final int LESS_EQUAL
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.
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.
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.
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.
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.
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.
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
getData
public java.util.Hashtable getData()
toString
public java.lang.String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index