public abstract class AbstractValue extends AbstractExpression implements Value
| Modifier and Type | Field and Description | 
|---|---|
protected java.lang.String | 
name  | 
protected short | 
struct  | 
protected short | 
type  | 
protected ValueWrapper | 
value  | 
block, rootSTRUCT_ARRAY, STRUCT_SCALAR, STRUCT_STRUCTURE, TYPE_BOOL, TYPE_DYNAMIC, TYPE_FLOAT, TYPE_INTEGER, TYPE_NUMERIC, TYPE_STRING, TYPE_UNDEF| Constructor and Description | 
|---|
AbstractValue()  | 
AbstractValue(Expression root)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
checkType()  | 
boolean | 
equals(java.lang.Object o)  | 
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. 
 | 
Expression | 
getExpression()
Return the equation associated expression. 
 | 
java.lang.String | 
getName()  | 
short | 
getStructure()
Return the value structure. 
 | 
short | 
getType()
Return the value type. 
 | 
java.lang.Object | 
getValue()
Return the value. 
 | 
boolean | 
getValueAsBoolean()
Return the value as a boolean. 
 | 
float | 
getValueAsFloat()
Return the value as a float. 
 | 
int | 
getValueAsInt()
Return the value as an int. 
 | 
int | 
hashCode()  | 
protected void | 
initType()  | 
protected void | 
setDefaultValue()
Set the default value for the type. 
 | 
void | 
setName(java.lang.String name)  | 
void | 
setStructure(short struct)
Set the structure of the value. 
 | 
void | 
setType(short type)
Set the type of the value. 
 | 
void | 
setType(short type,
       short struct)
Set the type and structure of the value. 
 | 
void | 
setValue(java.lang.Object value)  | 
void | 
setValueAsBoolean(boolean value)  | 
void | 
setValueAsFloat(float value)  | 
void | 
setValueAsInt(int value)  | 
clone, getParentBlock, getRoot, setParentBlock, setRootfinalize, getClass, notify, notifyAll, toString, wait, wait, waitclone, getExpressionName, getLocalVariable, getLocalVariables, getParentBlock, getResultStructure, getResultType, getRoot, getVariable, getVariable, getVariables, getVariables, hasVariable, hasVariable, removeVariable, setParentBlockprotected short type
protected short struct
protected ValueWrapper value
protected java.lang.String name
public AbstractValue()
public AbstractValue(Expression root)
public void setName(java.lang.String name)
public final void setType(short type,
                          short struct)
public final void setType(short type)
public final void setStructure(short struct)
setStructure in interface Valuestruct - the structureprotected void setDefaultValue()
protected void initType()
protected void checkType()
public Expression getExpression()
EquationgetExpression in interface EquationgetExpression in interface Expressionpublic java.lang.Object getValue()
Valuepublic int getValueAsInt()
ValuegetValueAsInt in interface Valuepublic float getValueAsFloat()
ValuegetValueAsFloat in interface Valuepublic boolean getValueAsBoolean()
ValuegetValueAsBoolean in interface Valuepublic void setValueAsInt(int value)
setValueAsInt in interface Valuepublic void setValueAsFloat(float value)
setValueAsFloat in interface Valuepublic void setValueAsBoolean(boolean value)
setValueAsBoolean in interface Valuepublic final 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 final 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 final 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()
                      throws java.lang.ArithmeticException
Expressioneval in interface Expressionjava.lang.ArithmeticExceptionpublic short getType()
public short getStructure()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence