public interface ExpressionNode
| Modifier and Type | Field and Description |
|---|---|
static int |
ADDITION_NODE
Node id for addition nodes
|
static int |
CONSTANT_NODE
Node id for constant nodes
|
static int |
EXPONENTIATION_NODE
Node id for exponentiation nodes
|
static int |
FUNCTION_NODE
Node id for function nodes
|
static int |
MULTIPLICATION_NODE
Node id for multiplication nodes
|
static int |
VARIABLE_NODE
Node id for variable nodes
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ExpressionNodeVisitor visitor)
Method needed for the visitor design pattern
|
int |
getType()
Returns the type of the node.ExpressionNode
Each class derived from ExpressionNode representing a specific
role in the expression should return the type according to that
role.
|
double |
getValue()
Calculates and returns the value of the sub-expression represented by
the node.
|
static final int VARIABLE_NODE
static final int CONSTANT_NODE
static final int ADDITION_NODE
static final int MULTIPLICATION_NODE
static final int EXPONENTIATION_NODE
static final int FUNCTION_NODE
int getType()
double getValue()
void accept(ExpressionNodeVisitor visitor)
visitor - the visitorCopyright © 2017. All rights reserved.