public abstract class Expression.Operator
extends java.lang.Object
Constructor and Description |
---|
Operator(java.lang.String oper,
int precedence,
boolean leftAssoc)
Creates a new operator.
|
Modifier and Type | Method and Description |
---|---|
abstract java.math.BigDecimal |
eval(java.math.BigDecimal v1,
java.math.BigDecimal v2)
Implementation for this operator.
|
java.lang.String |
getOper() |
int |
getPrecedence() |
boolean |
isLeftAssoc() |
public Operator(java.lang.String oper, int precedence, boolean leftAssoc)
oper
- The operator name (pattern).precedence
- The operators precedence.leftAssoc
- true
if the operator is left associative,
else false
.public java.lang.String getOper()
public int getPrecedence()
public boolean isLeftAssoc()
public abstract java.math.BigDecimal eval(java.math.BigDecimal v1, java.math.BigDecimal v2)
v1
- Operand 1.v2
- Operand 2.