Modifier and Type | Field and Description |
---|---|
private int |
value |
Constructor and Description |
---|
Constant(int value)
To create a Constant node, we need to specify the constant int value.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(TreeVisitor<T> visitor)
A tree node can accept the visit of any
TreeVisitor . |
int |
getValue() |
java.lang.String |
toString() |
getLeftOperand, getRightOperand
public Constant(int value)
value
- the constructed nodepublic int getValue()
public java.lang.String toString()
toString
in class java.lang.Object
public <T> T accept(TreeVisitor<T> visitor)
Tree
TreeVisitor
.visitor
- the tree visitor of generic type