Class StreamEvaluator

java.lang.Object
com.singularsys.extensions.stream.StreamEvaluator
All Implemented Interfaces:
Evaluator, JepComponent, Serializable

public class StreamEvaluator extends Object implements Evaluator
An evaluator that works with stream converting the final result of evaluate(Node) to a list. It also clears the clones created by StreamClone after each evaluation by calling StreamListProcessor.clearClones().
See Also:
  • Constructor Details

    • StreamEvaluator

      public StreamEvaluator(Evaluator base)
      Decorator constructor
      Parameters:
      base - evaluator for most calculations
  • Method Details

    • init

      public void init(Jep jep)
      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 interface JepComponent
      Parameters:
      jep - the current Jep instance
    • 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 a new instance, null or 'this'.
    • evaluate

      public Object evaluate(Node node) throws EvaluationException
      Evaluate the node
      Specified by:
      evaluate in interface Evaluator
      Parameters:
      node - the expression tree
      Returns:
      if the base result is a stream convert it to a list otherwise return the base result
      Throws:
      EvaluationException - if errors occur during evaluation;
    • eval

      public Object eval(Node node) throws EvaluationException
      Evaluate the node
      Specified by:
      eval in interface Evaluator
      Parameters:
      node - the expression tree
      Returns:
      the base result, may return a stream
      Throws:
      EvaluationException - if errors occur during evaluation;
    • getBase

      public Evaluator getBase()