public class ExprArrayAffect extends AbstractAssignment
| Modifier and Type | Field and Description |
|---|---|
protected Expression |
index |
protected Variable |
var |
isLocalexprblock, rootSTRUCT_ARRAY, STRUCT_SCALAR, STRUCT_STRUCTURE, TYPE_BOOL, TYPE_DYNAMIC, TYPE_FLOAT, TYPE_INTEGER, TYPE_NUMERIC, TYPE_STRING, TYPE_UNDEF| Constructor and Description |
|---|
ExprArrayAffect(Expression root) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
java.lang.Object |
eval()
Evaluate the expression.
|
boolean |
evalAsBoolean()
Evaluate the expression as a boolean.
|
float |
evalAsFloat()
Evaluate the expression as a float.
|
int |
evalAsInt()
Evaluate the expression as an int.
|
Variable |
getArray() |
Expression |
getExpression()
Return the associated expression.
|
java.lang.String |
getExpressionName()
Return the expression name.
|
Expression |
getIndex()
Return the index of the array to assign.
|
short |
getResultStructure()
Return the structure of the result for the expression.
|
short |
getResultType()
Return the type of the result for the expression.
|
Variable |
getVariable(java.lang.String varName)
Return a variable declared by the expression.
|
void |
setArray(Variable var) |
void |
setExpression(Expression expr) |
void |
setIndex(Expression index)
Set the index of the array to assign.
|
addLocalVariable, addLocalVariable, addVariable, addVariable, isCreated, isLocalgetVariablesgetParentBlock, getRoot, setParentBlock, setRootequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocalVariable, getLocalVariables, getParentBlock, getRoot, getVariable, getVariables, hasVariable, hasVariable, removeVariable, setParentBlockprotected Variable var
protected Expression index
public ExprArrayAffect(Expression root)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface Expressionclone in class AbstractExpressionjava.lang.CloneNotSupportedExceptionpublic Expression getIndex()
public void setIndex(Expression index)
index - the indexpublic Variable getArray()
public void setArray(Variable var)
public short getResultType()
ExpressionExpressionType.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 short getResultStructure()
ExpressionExpressionType.STRUCT_SCALAR: a scalar valueExpressionType.STRUCT_ARRAY: an array valuepublic Variable getVariable(java.lang.String varName)
ExpressionvarName - the variable namepublic void setExpression(Expression expr)
public Expression getExpression()
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 ExpressionevalAsFloat in class AbstractExpressionpublic 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 ExpressionevalAsInt in class AbstractExpressionpublic 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 ExpressionevalAsBoolean in class AbstractExpressionpublic java.lang.Object eval()
Expressionpublic java.lang.String getExpressionName()
ExpressionCopyright © 2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence