public class MathNode extends ExpressionNode
| Modifier and Type | Field and Description |
|---|---|
static int |
ADD
The plus operator.
|
static int |
AND
The bitwise and operator.
|
static int |
DIVIDE
The divide operator.
|
static int |
LSHIFT
The left shift operator.
|
static int |
MODULO
The modula operator.
|
static int |
MULTIPLY
The multiply operator.
|
static int |
NOT
The bitwise not operator (unary).
|
protected int |
op
The operation.
|
static int |
OR
The bitwise or operator.
|
static int |
RSHIFT
The right shift operator.
|
static int |
SUBSTRACT
The minus operator.
|
static int |
URSHIFT
The unsinged right shift operator.
|
static int |
XOR
The bitwise xor operator.
|
constant, constant_value, expressiontext, imports, static_type, textchildren, id, parent| Constructor and Description |
|---|
MathNode(jadex.javaparser.javaccimpl.ParserImpl p,
int id)
Create a node.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o)
Test if two nodes are equal.
|
static int |
fromString(java.lang.String operator)
Convert an operator from a string representation.
|
java.lang.Object |
getUnaryValue(IValueFetcher fetcher)
Evaluate the term.
|
java.lang.Object |
getValue(IValueFetcher fetcher)
Evaluate the expression in the given state
with respect to given parameters.
|
int |
hashCode()
Get the hash code for the node.
|
void |
precompile()
Precompute the static type and constant value if possible.
|
protected void |
precompileUnary()
Precompile unary node.
|
void |
setText(java.lang.String text)
Set the token text.
|
java.lang.String |
toPlainString()
Create a string representation of this node and its subnodes.
|
static java.lang.String |
toString(int operator)
Convert an operator to a string representation.
|
appendText, getConstantValue, getExpressionText, getParameters, getStaticType, getText, getUnboundParameterNodes, isConstant, precompileTree, setConstant, setConstantValue, setExpressionText, setStaticType, subnodeToString, throwEvaluationException, throwParseException, toString, toStringdump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParentpublic static final int ADD
public static final int SUBSTRACT
public static final int MULTIPLY
public static final int DIVIDE
public static final int MODULO
public static final int AND
public static final int OR
public static final int XOR
public static final int NOT
public static final int LSHIFT
public static final int RSHIFT
public static final int URSHIFT
protected int op
public MathNode(jadex.javaparser.javaccimpl.ParserImpl p,
int id)
p - The parser.id - The id.public void setText(java.lang.String text)
setText in class ExpressionNodetext - The token text.public void precompile()
precompile in class ExpressionNodepublic java.lang.Object getValue(IValueFetcher fetcher)
getValue in interface IParsedExpressiongetValue in class ExpressionNodeparams - The parameters (string, value pairs), if any.protected void precompileUnary()
public java.lang.Object getUnaryValue(IValueFetcher fetcher)
params - The parameters (string, value).public java.lang.String toPlainString()
toPlainString in interface NodetoPlainString in class ExpressionNodepublic static java.lang.String toString(int operator)
operator - The operatorpublic static int fromString(java.lang.String operator)
operator - The operator as string.public boolean equals(java.lang.Object o)
equals in class ExpressionNodepublic int hashCode()
hashCode in class ExpressionNode