Class StructuredEvaluator

  • All Implemented Interfaces:
    Evaluator, JepComponent, java.io.Serializable

    public class StructuredEvaluator
    extends java.lang.Object
    implements Evaluator
    An evaluator which works with structured programming.
    Since:
    Jep 3.5 / Extensions 2.0
    Author:
    Richard Morris
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      StructuredEvaluator​(Evaluator rootEval)
      Create an evaluator for use with structured programming.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object eval​(Node node)
      Evaluate a node.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StructuredEvaluator

        public StructuredEvaluator​(Evaluator rootEval)
        Create an evaluator for use with structured programming.
        Parameters:
        rootEval - the evaluator used for simple non-structured expressions
        See Also:
        StructureNode
    • Method Detail

      • evaluate

        public java.lang.Object evaluate​(Node node)
                                  throws EvaluationException
        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 interface Evaluator
        Parameters:
        node - node to evaluate
        Returns:
        value after evaluation
        Throws:
        EvaluationException - if errors occur during evaluation;
      • getLightWeightInstance

        public JepComponent getLightWeightInstance()
        Description copied from interface: JepComponent
        Gets a light-weight instance suitable for using in multiple threads.
        Specified by:
        getLightWeightInstance in interface JepComponent
        Returns:
        either an new instance, null or 'this'.
      • init

        public void init​(Jep jep)
        Description copied from interface: JepComponent
        Initialize the component. This methods 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 interface JepComponent
        Parameters:
        jep - the current Jep instance