|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.singularsys.jep.standard.StandardEvaluator
public final class StandardEvaluator
Field Summary | |
---|---|
protected java.util.Stack<java.lang.Object> |
stack
|
Constructor Summary | |
---|---|
StandardEvaluator()
|
Method Summary | |
---|---|
java.lang.Object |
eval(Node node)
Evaluates a sub expression. |
java.lang.Object |
evaluate(Node node)
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. |
void |
setTrapInfinity(boolean trapInfinity)
|
void |
setTrapNaN(boolean trapNaN)
|
void |
setTrapNullValues(boolean trapNullValues)
Sets whether null values for variables 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 void |
visitFun(Node node)
Visits a function/operator node. |
java.lang.Object |
visitVar(Node node)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient java.util.Stack<java.lang.Object> stack
Constructor Detail |
---|
public StandardEvaluator()
Method Detail |
---|
public void init(Jep jep)
JepComponent
init
in interface JepComponent
jep
- the current Jep instancepublic java.lang.Object eval(Node node) throws EvaluationException
Evaluator
eval
in interface Evaluator
EvaluationException
- if errors occur during evaluation;public java.lang.Object evaluate(Node node) throws EvaluationException
Evaluator
evaluate
in interface Evaluator
EvaluationException
- if errors occur during evaluation;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(ASTFunNode node, java.lang.Object data) throws EvaluationException
visit
in interface ParserVisitor
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(ASTOpNode node, java.lang.Object data) throws EvaluationException
visit
in interface ParserVisitor
EvaluationException
protected void visitFun(Node node) throws EvaluationException
node
-
EvaluationException
public 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |