public class Term extends java.lang.Object implements Expression
Modifier and Type | Field and Description |
---|---|
static int |
COMP_EQ |
static int |
COMP_EQS |
static int |
COMP_GE |
static int |
COMP_GT |
static int |
COMP_LE |
static int |
COMP_LT |
static int |
COMP_MTS |
static int |
COMP_NE |
static int |
COMP_NES |
static int |
COMP_NMS |
static int |
COMP_NONE |
Constructor and Description |
---|
Term(java.lang.Number value) |
Term(java.lang.String text) |
Modifier and Type | Method and Description |
---|---|
java.lang.Number |
evaluate()
returns the value of the expression
|
int |
getOperation()
returns the operation id of the expression
|
java.lang.String |
getText()
returns the original text of the expression
|
boolean |
isNegative()
returns the isNegative flag of the expression
|
boolean |
isNumeric()
returns true if the expression is numeric or false otherwise
|
void |
negate()
sets the isNegative flag to true
|
void |
setOperation(int op)
sets the operation to the expression
|
int |
size()
returns total number of the items in the expression
|
public static final int COMP_NONE
public static final int COMP_EQ
public static final int COMP_NE
public static final int COMP_GT
public static final int COMP_GE
public static final int COMP_LT
public static final int COMP_LE
public static final int COMP_EQS
public static final int COMP_NES
public static final int COMP_MTS
public static final int COMP_NMS
public java.lang.Number evaluate()
Expression
evaluate
in interface Expression
public int size()
Expression
size
in interface Expression
public boolean isNumeric()
Expression
isNumeric
in interface Expression
public java.lang.String getText()
Expression
getText
in interface Expression
public int getOperation()
Expression
getOperation
in interface Expression
public void setOperation(int op)
Expression
setOperation
in interface Expression
public boolean isNegative()
Expression
isNegative
in interface Expression
public void negate()
Expression
negate
in interface Expression