public class StackCheckingFastEvaluator extends java.lang.Object implements Evaluator, ParserVisitor
Modifier and Type | Field and Description |
---|---|
protected boolean |
trapInfinity |
protected boolean |
trapNaN |
protected boolean |
trapNullValues |
protected boolean |
trapUnsetValues
Whether null values for variables are trapped
|
Constructor and Description |
---|
StackCheckingFastEvaluator() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
eval(Node node)
Evaluates a sub expression.
|
java.lang.Object |
evaluate(Node node)
Main entry point, evaluates a node and returns and object with the value of the node.
|
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.
|
void |
init(Jep jep)
Initialize the component.
|
boolean |
isTrapInfinity() |
boolean |
isTrapNaN() |
boolean |
isTrapNullValues()
Whether null values for variables are trapped.
|
boolean |
isTrapUnsetValues()
Whether variables with unset values are trapped.
|
protected java.lang.Object |
nodeAccept(Node node) |
void |
setTrapInfinity(boolean trapInfinity) |
void |
setTrapNaN(boolean trapNaN) |
void |
setTrapNullValues(boolean trapNullValues)
Sets whether null values for variables are trapped.
|
void |
setTrapUnsetValues(boolean trapUnsetValues)
Sets whether unset variable values are trapped.
|
java.lang.Object |
visit(ASTConstant node,
java.lang.Object data) |
java.lang.Object |
visit(ASTFunNode node,
java.lang.Object data) |
java.lang.Object |
visit(ASTOpNode node,
java.lang.Object data) |
java.lang.Object |
visit(ASTVarNode node,
java.lang.Object data) |
java.lang.Object |
visitConstant(Node node) |
protected java.lang.Object |
visitFun(Node node)
Visits a function/operator node.
|
java.lang.Object |
visitVar(Node node) |
protected boolean trapUnsetValues
protected boolean trapNullValues
protected boolean trapNaN
protected boolean trapInfinity
public void init(Jep jep)
JepComponent
init
in interface JepComponent
jep
- the current Jep instancepublic java.lang.Object eval(Node node) throws EvaluationException
Evaluator
CallbackEvaluationI
eval
in interface Evaluator
node
- node to evaluateEvaluationException
- if errors occur during evaluation;public java.lang.Object evaluate(Node node) throws EvaluationException
Evaluator
evaluate
in interface Evaluator
node
- node to evaluateEvaluationException
- if errors occur during evaluation;protected java.lang.Object nodeAccept(Node node) throws EvaluationException
EvaluationException
public java.lang.Object visit(ASTConstant node, java.lang.Object data) throws EvaluationException
visit
in interface ParserVisitor
EvaluationException
public java.lang.Object visitConstant(Node node) throws EvaluationException
EvaluationException
public java.lang.Object visit(ASTVarNode node, java.lang.Object data) throws EvaluationException
visit
in interface ParserVisitor
EvaluationException
public java.lang.Object visitVar(Node node) throws EvaluationException
EvaluationException
public java.lang.Object visit(ASTFunNode node, java.lang.Object data) throws EvaluationException
visit
in interface ParserVisitor
EvaluationException
public java.lang.Object visit(ASTOpNode node, java.lang.Object data) throws EvaluationException
visit
in interface ParserVisitor
EvaluationException
protected java.lang.Object visitFun(Node node) throws EvaluationException
node
- EvaluationException
public boolean isTrapUnsetValues()
public void setTrapUnsetValues(boolean trapUnsetValues)
Variable.setValidValue(boolean)
or cleared
using VariableTable.clearValues()
.trapUnsetValues
- true to trap unset values, false to ignore thempublic boolean isTrapNullValues()
public void setTrapNullValues(boolean trapNullValues)
trapNullValues
- public boolean isTrapNaN()
public void setTrapNaN(boolean trapNaN)
public boolean isTrapInfinity()
public void setTrapInfinity(boolean trapInfinity)
public JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance
in interface JepComponent
Copyright © 2018 Singular Systems http://www.singularsys.com/jep