T
- public class ComplexEvalVisitor extends AbstractASTVisitor<Complex,ComplexVariable,Complex>
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
Constructor and Description |
---|
ComplexEvalVisitor() |
Modifier and Type | Method and Description |
---|---|
void |
clearVariables()
Clear all defined variables for this evaluator.
|
void |
defineVariable(String variableName,
BooleanVariable value)
Define a boolean value for a given variable name.
|
void |
defineVariable(String variableName,
ComplexVariable value)
Define a value for a given variable name.
|
boolean |
evaluateFunctionLogical(FunctionNode functionNode) |
boolean |
evaluateNodeLogical(ASTNode node) |
Complex |
getResult() |
ComplexVariable |
getVariable(String variableName)
Returns the Complex variable value to which the specified variableName is
mapped, or
null if this map contains no mapping for the
variableName. |
ASTNode |
optimizeFunction(FunctionNode functionNode)
Optimize an already parsed in
functionNode into an
ASTNode . |
void |
setUp(Complex data)
Before a visitor run starts this method will be called.
|
void |
tearDown()
After a visitor run has finished this method will be called.
|
Complex |
visit(ComplexNode node) |
Complex |
visit(DoubleNode node) |
Complex |
visit(FloatNode node) |
Complex |
visit(FractionNode node) |
Complex |
visit(FunctionNode functionNode) |
Complex |
visit(IntegerNode node) |
Complex |
visit(PatternNode node) |
Complex |
visit(StringNode node) |
Complex |
visit(SymbolNode node) |
evaluateNode
public static final boolean DEBUG
public Complex getResult()
public void setUp(Complex data)
IASTVisitor
setUp
in interface IASTVisitor<Complex,ComplexVariable,Complex>
setUp
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public void tearDown()
IASTVisitor
tearDown
in interface IASTVisitor<Complex,ComplexVariable,Complex>
tearDown
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(ComplexNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(DoubleNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(FloatNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(FractionNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(FunctionNode functionNode)
public Complex visit(IntegerNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(PatternNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(StringNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public Complex visit(SymbolNode node)
visit
in interface IASTVisitor<Complex,ComplexVariable,Complex>
visit
in class AbstractASTVisitor<Complex,ComplexVariable,Complex>
public boolean evaluateNodeLogical(ASTNode node)
public boolean evaluateFunctionLogical(FunctionNode functionNode)
public void defineVariable(String variableName, ComplexVariable value)
variableName
- value
- public ComplexVariable getVariable(String variableName)
null
if this map contains no mapping for the
variableName.variableName
- public void defineVariable(String variableName, BooleanVariable value)
variableName
- value
- public void clearVariables()
public ASTNode optimizeFunction(FunctionNode functionNode)
functionNode
into an
ASTNode
.functionNode
- Copyright © 2015. All rights reserved.