public static class CalculatorExpr.Operation
extends java.lang.Object
operator_
operates with the CalculatorExpr#accu
, the Operation#value
and maybe the CalculatorExpr#stack
.
#value
.
#ixVariable
is set >=0
kindOperand
= -2
datapath()
is set.
Modifier and Type | Field and Description |
---|---|
protected static int |
kArgumentUndefined
Designation of
kindOperand that the operand should be located in the top of stack. |
private static int |
kCheckBoolExpr |
static int |
kConstant
Designation of
kindOperand that the operand should be located in the top of stack. |
static int |
kDatapath
Designation of
kindOperand that the operand should be located in the top of stack. |
protected int |
kindOperand
Number of input variable from array or special designation.
|
static int |
kStackOperand
Designation of
kindOperand that the operand should be located in the top of stack. |
static int |
kUnaryOperation
Designation of
kindOperand that the operand is the accumulator for unary operation. |
(package private) CalculatorExpr.Operand |
operand_ |
protected CalculatorExpr.Operator |
operator_
The operator for this operation.
|
private char |
operatorChar
Deprecated.
|
(package private) java.lang.Object |
oValue
Deprecated.
|
(package private) CalculatorExpr.Operator |
unaryOperator
Either it is null or the operation has a single unary operator for the argument.
|
(package private) java.util.List<CalculatorExpr.Operator> |
unaryOperators
Either it is null or the operation has some unary operators (more as one).
|
(package private) double |
value_d
Deprecated.
|
Constructor and Description |
---|
Operation()
Set if the value of the operation should be gotten by data access on calculation time.
|
Operation(CalculatorExpr.Operator op,
CalculatorExpr.Value value) |
Operation(CalculatorExpr.Operator op,
int kindOperand) |
Operation(CalculatorExpr.Operator operator,
java.lang.Object oValue) |
Operation(java.lang.String op,
CalculatorExpr.Operand operand)
Create an Operation with a given constant value
|
Operation(java.lang.String op,
CalculatorExpr.Value value)
Create an Operation with a given constant value
|
Operation(java.lang.String operation,
double value) |
Operation(java.lang.String op,
int ixVariable) |
Operation(java.lang.String op,
java.lang.String value)
Create an Operation with a String literal (comparison, starts, concat etc.)
|
Modifier and Type | Method and Description |
---|---|
void |
add_datapathElement(DataAccess.DatapathElement item) |
void |
addUnaryOperator(CalculatorExpr.Operator unary)
Sets one of some unary operators.
|
boolean |
addUnaryOperator(java.lang.String op) |
DataAccess |
datapath()
Returns the datapath of this operation or null if the operator is not a datapath.
|
boolean |
hasOperator() |
boolean |
hasUnaryOperator() |
CalculatorExpr.Operand |
operand() |
CalculatorExpr.Operator |
operator() |
void |
set_charValue(char val) |
void |
set_doubleValue(double val) |
void |
set_intValue(int val) |
void |
set_textValue(java.lang.String val) |
void |
setOperator(CalculatorExpr.Operator op) |
boolean |
setOperator(java.lang.String op) |
void |
setStackOperand()
Designates that the operand should be located in the top of stack.
|
java.lang.String |
toString() |
protected static final int kArgumentUndefined
kindOperand
that the operand should be located in the top of stack.public static final int kConstant
kindOperand
that the operand should be located in the top of stack.public static final int kDatapath
kindOperand
that the operand should be located in the top of stack.public static final int kStackOperand
kindOperand
that the operand should be located in the top of stack.public static final int kUnaryOperation
kindOperand
that the operand is the accumulator for unary operation.private static final int kCheckBoolExpr
@Deprecated private char operatorChar
protected CalculatorExpr.Operator operator_
CalculatorExpr.Operator unaryOperator
java.util.List<CalculatorExpr.Operator> unaryOperators
CalculatorExpr.Operand operand_
protected int kindOperand
kStackOperand
@Deprecated double value_d
@Deprecated java.lang.Object oValue
public Operation()
public Operation(java.lang.String op, java.lang.String value)
op
- String given operandvalue
- String valuepublic Operation(java.lang.String op, CalculatorExpr.Operand operand)
op
- String given operandvalue
- usual numericalpublic Operation(java.lang.String op, CalculatorExpr.Value value)
op
- String given operandvalue
- usual numericalpublic Operation(CalculatorExpr.Operator op, CalculatorExpr.Value value)
public Operation(CalculatorExpr.Operator op, int kindOperand)
public Operation(java.lang.String op, int ixVariable)
op
- ixVariable
- negative, then it is a kindOperand. Positiv, then index of variableOperation(java.lang.String operation, double value)
Operation(CalculatorExpr.Operator operator, java.lang.Object oValue)
public CalculatorExpr.Operand operand()
public CalculatorExpr.Operator operator()
public boolean hasOperator()
public boolean hasUnaryOperator()
public void add_datapathElement(DataAccess.DatapathElement item)
public void set_intValue(int val)
public void set_doubleValue(double val)
public void set_charValue(char val)
public void set_textValue(java.lang.String val)
public void setStackOperand()
public void addUnaryOperator(CalculatorExpr.Operator unary)
unary
- public boolean addUnaryOperator(java.lang.String op)
public void setOperator(CalculatorExpr.Operator op)
public boolean setOperator(java.lang.String op)
public DataAccess datapath()
public java.lang.String toString()
toString
in class java.lang.Object