public class Variable extends Operand
VariableRepository
Operand
,
VariableRepository
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
name |
Constructor and Description |
---|
Variable(java.lang.String name)
To create a Variable node, we need to specify the variable name (unique).
|
Modifier and Type | Method and Description |
---|---|
int |
calculate()
To calculate a Variable node, we need to fetch the stocked value of the
variable in
VariableRepository . |
java.lang.String |
getName() |
java.lang.String |
toString() |
getLeftOperand, getRightOperand
public Variable(java.lang.String name)
name
- the name of the variable, unique valuepublic java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public int calculate()
VariableRepository
.