public static class CalculatorExpr.Operand
extends java.lang.Object
CalculatorExpr.Operation
.Modifier and Type | Field and Description |
---|---|
DataAccess |
dataAccess
Set if the value uses reflection.
|
java.lang.Object |
dataConst
Set for constant data.
|
CalculatorExpr |
expr
If not null the operand is calculated with an expression itself.
|
int |
ixValue
Index of the value contained in a given array on execution, -1 if not used.
|
java.lang.String |
textOrVar
The String literal or the given sDatapath.
|
Constructor and Description |
---|
Operand(CalculatorExpr.Value value) |
Operand(CalculatorExpr expr) |
Operand(int ixValue,
DataAccess dataAccess,
java.lang.Object dataConst,
java.lang.String textOrVar)
Constructs
|
Operand(java.lang.String text)
A ValueAccess without value, only a constant text literal, especially for Text Cmd.
|
Operand(java.lang.String sDatapath,
java.util.Map<java.lang.String,DataAccess.IntegerIx> variables,
java.lang.Class<?> reflData)
Deprecated.
it should be possible to use
Operand#Operand(StringPartScan, Map, Class) in all cases. |
Operand(StringPartScan sDatapath,
java.util.Map<java.lang.String,DataAccess.IntegerIx> variables,
java.lang.Class<?> reflData,
boolean bSpecialSyntax)
Either a value access with given data (base of
Argument , or a Command with value access, base of Cmd |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
calc(java.util.Map<java.lang.String,DataAccess.IntegerIx> nameVariables,
java.lang.Object[] varValues)
Accesses and returns the value of this operand.
|
java.lang.String |
toString() |
public int ixValue
public final DataAccess dataAccess
public final java.lang.Object dataConst
public final java.lang.String textOrVar
public final CalculatorExpr expr
public Operand(java.lang.String text)
text
- public Operand(CalculatorExpr expr)
public Operand(int ixValue, DataAccess dataAccess, java.lang.Object dataConst, java.lang.String textOrVar)
ixValue
- -1 if no variable is useddataAccess
- maybe null, the access inside a given variable if ixValue >=0dataConst
- textOrVar
- Name of the variabe if ixValue >=0, constant text if ixValue <0public Operand(CalculatorExpr.Value value)
public Operand(java.lang.String sDatapath, java.util.Map<java.lang.String,DataAccess.IntegerIx> variables, java.lang.Class<?> reflData) throws java.lang.Exception
Operand#Operand(StringPartScan, Map, Class)
in all cases.Argument
, or a Command with value access, base of Cmd
sDatapath
- textual given value. It is either a literal, a simple variable ...TODO docuvariables
- Container with some variable names associated to indices in a value array.reflData
- type wich can contain a static member with the required name in sDatapath if the name is not found in variablesjava.lang.Exception
public Operand(StringPartScan sDatapath, java.util.Map<java.lang.String,DataAccess.IntegerIx> variables, java.lang.Class<?> reflData, boolean bSpecialSyntax) throws java.text.ParseException
Argument
, or a Command with value access, base of Cmd
sDatapath
- textual given value. It is either a literal, a simple variable ...TODO docuvariables
- Container with some variable names associated to indices in a value array.
see DataAccess.DataAccess(StringPartScan, Map, Class, char)
reflData
- type wich can contain a static member with the required name in sDatapath if the name is not found in variablesjava.lang.Exception
java.text.ParseException
public java.lang.Object calc(java.util.Map<java.lang.String,DataAccess.IntegerIx> nameVariables, java.lang.Object[] varValues) throws java.lang.Exception
ixValue
. If ixValue
is <0 then either the given dataConst
or the textOrVar
is returned.nameVariables
- see DataAccess.access(List, Object, boolean, boolean, Map, Object[], boolean, org.vishia.util.DataAccess.Dst)
necessary on indirect access to variable via String, construct such as <&&(path)>varValues
- Array of possible values proper to the given ixValue
dataAccess
is given, it accesses with the given start Objectjava.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object