public class ExprDecrement extends AbstractExpression
block, root
STRUCT_ARRAY, STRUCT_SCALAR, STRUCT_STRUCTURE, TYPE_BOOL, TYPE_DYNAMIC, TYPE_FLOAT, TYPE_INTEGER, TYPE_NUMERIC, TYPE_STRING, TYPE_UNDEF
Constructor and Description |
---|
ExprDecrement(Expression root) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
java.lang.Object |
eval()
Evaluate the expression.
|
float |
evalAsFloat()
Evaluate the expression as a float.
|
int |
evalAsInt()
Evaluate the expression as an int.
|
java.lang.String |
getExpressionName()
Return the expression name.
|
short |
getResultStructure()
Return the structure of the result for the expression.
|
short |
getResultType()
Return the type of the result for the expression.
|
Variable |
getVariable() |
Variable |
getVariable(java.lang.String varName)
Return a variable declared by the expression.
|
java.util.Map<java.lang.String,Variable> |
getVariables()
Return the variables used by this expression.
|
void |
setVariable(Variable var) |
evalAsBoolean, getParentBlock, getRoot, setParentBlock, setRoot
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExpression, getLocalVariable, getLocalVariables, getVariable, getVariables, hasVariable, hasVariable, removeVariable
public ExprDecrement(Expression root)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface Expression
clone
in class AbstractExpression
java.lang.CloneNotSupportedException
public java.lang.String getExpressionName()
Expression
public void setVariable(Variable var)
public Variable getVariable()
public final int evalAsInt()
Expression
Expression.eval()
, but the evaluation
engine will be able to optimize the computation by knwoing that the result is an int (primitive valeus are cached internally).evalAsInt
in interface Expression
evalAsInt
in class AbstractExpression
public final float evalAsFloat()
Expression
Expression.eval()
, but the evaluation
engine will be able to optimize the computation by knwoing that the result is a float (primitive valeus are cached internally).evalAsFloat
in interface Expression
evalAsFloat
in class AbstractExpression
public java.lang.Object eval() throws java.lang.ArithmeticException
Expression
java.lang.ArithmeticException
public short getResultStructure()
Expression
ExpressionType.STRUCT_SCALAR
: a scalar valueExpressionType.STRUCT_ARRAY
: an array valuepublic short getResultType()
Expression
ExpressionType.TYPE_INTEGER
: integerExpressionType.TYPE_FLOAT
: floatExpressionType.TYPE_NUMERIC
: integer or float value. The runtime actual type may depend on the expression argumentsExpressionType.TYPE_STRING
: stringExpressionType.TYPE_DYNAMIC
: dynamic type. The runtime actual type may depend on the expression argumentsExpressionType.TYPE_UNDEF
: undefined type. The default type, characteristic of an error if entountered.public java.util.Map<java.lang.String,Variable> getVariables()
Expression
int c=a+b
, only "a" and "b" will be returned.public Variable getVariable(java.lang.String varName)
Expression
varName
- the variable nameCopyright © 2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence