Class StructuredEvaluator
java.lang.Object
com.singularsys.extensions.structure.StructuredEvaluator
- All Implemented Interfaces:
Evaluator,JepComponent,Serializable
An evaluator which works with structured programming.
- Since:
- Jep 3.5 / Extensions 2.0
- Author:
- Richard Morris
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStructuredEvaluator(Evaluator rootEval) Create an evaluator for use with structured programming. -
Method Summary
Modifier and TypeMethodDescriptionEvaluate a node.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.Gets the root evaluator.voidInitialize the component.
-
Constructor Details
-
StructuredEvaluator
Create an evaluator for use with structured programming.- Parameters:
rootEval- the evaluator used for simple non-structured expressions- See Also:
-
-
Method Details
-
evaluate
Description copied from interface:EvaluatorMain entry point, evaluates a node and returns and object with the value of the node.- Specified by:
evaluatein interfaceEvaluator- Parameters:
node- node to evaluate- Returns:
- value after evaluation
- Throws:
EvaluationException- if errors occur during evaluation;
-
eval
Evaluate a node. If the node is an instance ofStructureNodecall itsStructureNode.eval(Evaluator)method, otherwise use the rootEvaluator.- Specified by:
evalin interfaceEvaluator- Parameters:
node- node to evaluate- Returns:
- The value after evaluating the sub expression.
- Throws:
EvaluationException- if errors occur during evaluation;
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-
init
Description copied from interface:JepComponentInitialize 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:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
getRootEval
Gets the root evaluator.- Returns:
- the evaluator
- Since:
- Jep 4.1, extensions 2.2
-