public class SetVariable extends Object implements ExpressionNodeVisitor
| Constructor and Description |
|---|
SetVariable(String name,
double value)
Construct the visitor with the name and the value of the variable to set
|
| Modifier and Type | Method and Description |
|---|---|
void |
visit(AdditionExpressionNode node)
Do nothing
|
void |
visit(ConstantExpressionNode node)
Do nothing
|
void |
visit(ExponentiationExpressionNode node)
Do nothing
|
void |
visit(FunctionExpressionNode node)
Do nothing
|
void |
visit(MultiplicationExpressionNode node)
Do nothing
|
void |
visit(VariableExpressionNode node)
Checks the nodes name against the name to set and sets the value if the two
strings match
|
public SetVariable(String name, double value)
name - the name of the variablevalue - the value of the variablepublic void visit(VariableExpressionNode node)
visit in interface ExpressionNodeVisitorpublic void visit(ConstantExpressionNode node)
visit in interface ExpressionNodeVisitorpublic void visit(AdditionExpressionNode node)
visit in interface ExpressionNodeVisitorpublic void visit(MultiplicationExpressionNode node)
visit in interface ExpressionNodeVisitorpublic void visit(ExponentiationExpressionNode node)
visit in interface ExpressionNodeVisitorpublic void visit(FunctionExpressionNode node)
visit in interface ExpressionNodeVisitorCopyright © 2017. All rights reserved.