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()
Expressionevaluate in interface Expressionpublic int size()
Expressionsize in interface Expressionpublic boolean isNumeric()
ExpressionisNumeric in interface Expressionpublic java.lang.String getText()
ExpressiongetText in interface Expressionpublic int getOperation()
ExpressiongetOperation in interface Expressionpublic void setOperation(int op)
ExpressionsetOperation in interface Expressionpublic boolean isNegative()
ExpressionisNegative in interface Expressionpublic void negate()
Expressionnegate in interface Expression