public abstract class AbstractExpression extends java.lang.Object implements Expression
eval() methods which cefault to Expression.eval().| Modifier and Type | Field and Description |
|---|---|
protected CodeBlock |
block |
protected Expression |
root |
STRUCT_ARRAY, STRUCT_SCALAR, STRUCT_STRUCTURE, TYPE_BOOL, TYPE_DYNAMIC, TYPE_FLOAT, TYPE_INTEGER, TYPE_NUMERIC, TYPE_STRING, TYPE_UNDEF| Constructor and Description |
|---|
AbstractExpression() |
AbstractExpression(Expression root) |
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.Object |
clone() |
boolean |
evalAsBoolean()
Evaluate the expression as a boolean.
|
float |
evalAsFloat()
Evaluate the expression as a float.
|
int |
evalAsInt()
Evaluate the expression as an int.
|
CodeBlock |
getParentBlock()
Return the parent expression block if the expression is one of several expressions separated by commas.
|
Expression |
getRoot()
Return the root expression.
|
void |
setParentBlock(CodeBlock block)
Set the parent expression block.
|
void |
setRoot(Expression root)
Set the root expression.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waiteval, getExpression, getExpressionName, getLocalVariable, getLocalVariables, getResultStructure, getResultType, getVariable, getVariable, getVariables, getVariables, hasVariable, hasVariable, removeVariableprotected CodeBlock block
protected Expression root
public AbstractExpression()
public AbstractExpression(Expression root)
public void setRoot(Expression root)
root - the root expressionpublic abstract java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface Expressionclone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic void setParentBlock(CodeBlock block)
ExpressionsetParentBlock in interface Expressionblock - the parent expression blockpublic CodeBlock getParentBlock()
Expressionb=a+2; return b, the two "b=a+2" and "return b" have "b=a+2; return b" as their
parent block.getParentBlock in interface Expressionpublic Expression getRoot()
getRoot in interface Expressionpublic int evalAsInt()
ExpressionExpression.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 Expressionpublic float evalAsFloat()
ExpressionExpression.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 Expressionpublic boolean evalAsBoolean()
ExpressionExpression.eval(), but the evaluation
engine will be able to optimize the computation by knwoing that the result is a boolean (primitive valeus are cached internally).evalAsBoolean in interface ExpressionCopyright © 2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence