Class PostfixEvaluationConsole

java.lang.Object
com.singularsys.jepexamples.consoles.Console
com.singularsys.jepexamples.consoles.PostfixEvaluationConsole

public class PostfixEvaluationConsole extends Console
A console using the PostfixEvaluator to evaluate expressions.
  • Constructor Details

    • PostfixEvaluationConsole

      public PostfixEvaluationConsole()
  • Method Details

    • main

      public static void main(String[] args)
      Parameters:
      args -
    • initialise

      public void initialise()
      Description copied from class: Console
      sets up all the needed objects.
      Overrides:
      initialise in class Console
    • processEquation

      public Object processEquation(Node node)
      Description copied from class: Console
      Performs the required operation on a node. Typically, evaluates the node and prints the value.
      Overrides:
      processEquation in class Console
      Parameters:
      node - Node representing expression
      Returns:
      The result of the calculation
    • setMonitor

      public void setMonitor(String[] args)
      Description copied from class: Console
      Sets up monitoring of the call tree. Calls Console.setEvaluator(Evaluator) with a MonitoringEvaluator, sub-classes may need to override this method disable this feature.
      Overrides:
      setMonitor in class Console
      Parameters:
      args - second argument can be one of "off", "calls" or "times"
    • setEvaluator

      public void setEvaluator(Evaluator ev)
      Description copied from class: Console
      Sets the evaluator used. Default method simple calls Jep.setComponent(com.singularsys.jep.JepComponent) with the evaluator.
      Overrides:
      setEvaluator in class Console
      Parameters:
      ev - the evaluator to use