public class Constant extends AbstractValue
| Modifier and Type | Field and Description |
|---|---|
static Constant |
EMPTY_STRING
The constant which hold an empty String.
|
static Constant |
FALSE
The constant which hold the value false.
|
static Constant |
ONE_F
The constant which hold the value 1 as an float.
|
static Constant |
ONE_I
The constant which hold the value 1 as an int.
|
static Constant |
TRUE
The constant which hold the value true.
|
static Constant |
ZERO_F
The constant which hold the value 0 as a float.
|
static Constant |
ZERO_I
The constant which hold the value 0 as an int.
|
name, struct, type, valueblock, rootSTRUCT_ARRAY, STRUCT_SCALAR, STRUCT_STRUCTURE, TYPE_BOOL, TYPE_DYNAMIC, TYPE_FLOAT, TYPE_INTEGER, TYPE_NUMERIC, TYPE_STRING, TYPE_UNDEF| Constructor and Description |
|---|
Constant(Expression root,
java.lang.Object value)
Constructor.
|
Constant(java.lang.Object value)
Constructor.
|
Constant(java.lang.Object value,
short type)
Constructor.
|
Constant(java.lang.Object value,
short type,
short struct)
Constructor.
|
Constant(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 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(java.lang.String varName)
Return null.
|
java.util.Map<java.lang.String,Variable> |
getVariables()
Return an empty Map.
|
int |
hashCode() |
void |
setValue(java.lang.String varName,
java.lang.Object value)
Do nothing.
|
checkType, eval, evalAsBoolean, evalAsFloat, evalAsInt, getExpression, getName, getStructure, getType, getValue, getValueAsBoolean, getValueAsFloat, getValueAsInt, initType, setDefaultValue, setName, setStructure, setType, setType, setValue, setValueAsBoolean, setValueAsFloat, setValueAsIntgetParentBlock, getRoot, setParentBlock, setRootfinalize, getClass, notify, notifyAll, toString, wait, wait, waitgetLocalVariable, getLocalVariables, getParentBlock, getRoot, getVariable, getVariables, hasVariable, hasVariable, removeVariable, setParentBlockpublic static final Constant TRUE
public static final Constant FALSE
public static final Constant ZERO_I
public static final Constant ZERO_F
public static final Constant ONE_I
public static final Constant ONE_F
public static final Constant EMPTY_STRING
public Constant(java.lang.Object value)
value - the valuepublic Constant(Expression root, java.lang.Object value)
value - the valuepublic Constant(java.lang.Object value,
short type)
value - the valuetype - the typepublic Constant(short type,
short struct)
type - the typestruct - the structurepublic Constant(java.lang.Object value,
short type,
short struct)
type - the typestruct - the structurevalue - the valuepublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface Expressionclone in class AbstractExpressionjava.lang.CloneNotSupportedExceptionpublic java.lang.String getExpressionName()
Expressionpublic 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 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 AbstractValuepublic int hashCode()
hashCode in class AbstractValueCopyright © 2018 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence