Package com.singularsys.jep.standard
Class UncheckedEvaluator
java.lang.Object
com.singularsys.jep.standard.UncheckedEvaluator
- All Implemented Interfaces:
Evaluator
,JepComponent
,ParserVisitor
,Serializable
An evaluator which does fewer checks on values with a 5% faster speed.
- Since:
- 3.5
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionEvaluates a sub expression.Main entry point, evaluates a node and returns and object with the value of the node.Gets a light-weight instance suitable for using in multiple threads.void
Initialize the component.visit
(ASTConstant node, Object data) visit
(ASTFunNode node, Object data) visit
(ASTVarNode node, Object data) visitConstant
(Node node)
-
Constructor Details
-
UncheckedEvaluator
public UncheckedEvaluator()
-
-
Method Details
-
init
Description copied from interface:JepComponent
Initialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.- Specified by:
init
in interfaceJepComponent
- Parameters:
jep
- the current Jep instance
-
eval
Description copied from interface:Evaluator
Evaluates a sub expression. This method can be called by PostfixMathCommands which implementCallbackEvaluationI
- Specified by:
eval
in interfaceEvaluator
- Parameters:
node
- node to evaluate- Returns:
- The value after evaluating the sub expression.
- Throws:
EvaluationException
- if errors occur during evaluation;
-
evaluate
Description copied from interface:Evaluator
Main entry point, evaluates a node and returns and object with the value of the node.- Specified by:
evaluate
in interfaceEvaluator
- Parameters:
node
- node to evaluate- Returns:
- value after evaluation
- Throws:
EvaluationException
- if errors occur during evaluation;
-
visit
- Specified by:
visit
in interfaceParserVisitor
- Throws:
EvaluationException
-
visitConstant
-
visit
- Specified by:
visit
in interfaceParserVisitor
- Throws:
EvaluationException
-
visitVar
-
visit
- Specified by:
visit
in interfaceParserVisitor
- Throws:
EvaluationException
-
visit
- Specified by:
visit
in interfaceParserVisitor
- Throws:
EvaluationException
-
getLightWeightInstance
Description copied from interface:JepComponent
Gets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstance
in interfaceJepComponent
- Returns:
- a new FastEvaluator
-