public class Variable extends AbstractValue
name, struct, type, value
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 |
---|
Variable(java.lang.String name)
Constructor.
|
Variable(java.lang.String name,
java.lang.Object value)
Constructor.
|
Variable(java.lang.String name,
short type)
Constructor.
|
Variable(java.lang.String name,
short type,
java.lang.Object value)
Constructor.
|
Variable(java.lang.String name,
short type,
java.lang.Object value,
short struct)
Constructor.
|
Variable(java.lang.String name,
short type,
short struct)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getExpressionName()
Return the variable name.
|
short |
getResultStructure()
Return the structure of the result for the expression.
|
short |
getResultType()
Return the type of the Variable.
|
Variable |
getVariable(java.lang.String varName)
Return the value of the variable.
|
java.util.Map<java.lang.String,Variable> |
getVariables()
Return the Map of variables.
|
int |
hashCode() |
boolean |
isLocal()
Return true if the variable is a local variable.
|
void |
setValue(java.lang.String varName,
java.lang.Object value)
Set the value of the variable.
|
checkType, eval, evalAsBoolean, evalAsFloat, evalAsInt, getExpression, getName, getStructure, getType, getValue, getValueAsBoolean, getValueAsFloat, getValueAsInt, initType, setDefaultValue, setName, setStructure, setType, setType, setValue, setValueAsBoolean, setValueAsFloat, setValueAsInt
getParentBlock, getRoot, setParentBlock, setRoot
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getLocalVariable, getLocalVariables, getParentBlock, getRoot, getVariable, getVariables, hasVariable, hasVariable, removeVariable, setParentBlock
public Variable(java.lang.String name)
name
- the variable namepublic Variable(java.lang.String name, short type)
name
- the variable nametype
- the variable typepublic Variable(java.lang.String name, short type, short struct)
name
- the variable nametype
- the variable typestruct
- the variable structurepublic Variable(java.lang.String name, short type, java.lang.Object value)
name
- the variable nametype
- the variable typevalue
- the variable valuepublic Variable(java.lang.String name, short type, java.lang.Object value, short struct)
name
- the variable nametype
- the variable typestruct
- the variable structurevalue
- the variable valuepublic Variable(java.lang.String name, java.lang.Object value)
name
- the variable namevalue
- the variable valuepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface Expression
clone
in class AbstractExpression
java.lang.CloneNotSupportedException
public boolean isLocal()
public java.lang.String getExpressionName()
public short getResultType()
public short getResultStructure()
Expression
ExpressionType.STRUCT_SCALAR
: a scalar valueExpressionType.STRUCT_ARRAY
: an array valuepublic java.util.Map<java.lang.String,Variable> getVariables()
public Variable getVariable(java.lang.String varName)
varName
- the variable namepublic void setValue(java.lang.String varName, java.lang.Object value)
varName
- the variable namevalue
- the variable valuepublic boolean equals(java.lang.Object o)
equals
in class AbstractValue
public int hashCode()
hashCode
in class AbstractValue
Copyright © 2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence