public class AdditionExpressionNode extends SequenceExpressionNode
SequenceExpressionNode.TermtermsADDITION_NODE, CONSTANT_NODE, EXPONENTIATION_NODE, FUNCTION_NODE, MULTIPLICATION_NODE, VARIABLE_NODE| Constructor and Description |
|---|
AdditionExpressionNode(ExpressionNode node,
boolean positive)
Constructor to create an addition with the first term already added.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ExpressionNodeVisitor visitor)
Implementation of the visitor design pattern.
|
int |
getType()
Returns the type of the node, in this case ExpressionNode.ADDITION_NODE
|
double |
getValue()
Returns the value of the sub-expression that is rooted at this node.
|
addpublic AdditionExpressionNode(ExpressionNode node, boolean positive)
node - the term to be addedpositive - a flag indicating whether the term is added or subtractedpublic int getType()
public double getValue()
public void accept(ExpressionNodeVisitor visitor)
visitor - the visitorCopyright © 2017. All rights reserved.