Class RpEvaluator

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

    public class RpEvaluator
    extends java.lang.Object
    implements Evaluator
    An evaluator using the RpEval system. Note that using this evaluator is slower than using the RpEval class directly.
    Author:
    Richard Morris
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      RpEvaluator​(boolean updateJepVariables)
      Constructor
    • Constructor Detail

      • RpEvaluator

        public RpEvaluator​(boolean updateJepVariables)
        Constructor
        Parameters:
        updateJepVariables - whether to update jep variable after each call to evaluate
    • Method Detail

      • eval

        public java.lang.Object eval​(Node node)
                              throws EvaluationException
        Description copied from interface: Evaluator
        Evaluates a sub expression. This method can be called by PostfixMathCommands which implement CallbackEvaluationI
        Specified by:
        eval in interface Evaluator
        Parameters:
        node - node to evaluate
        Returns:
        The value after evaluating the sub expression.
        Throws:
        EvaluationException - if errors occur during evaluation;
      • 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
      • updateJepVariables

        public void updateJepVariables()