Interface Evaluator

  • All Known Implementing Classes:
    SqlEvaluator

    public interface Evaluator
    An Evaluator will evaluate an expression.

    An evaluator takes a set of values (the environment) and evaluates an expression in it, returning a Result. For example, it might evaluate a (previously given) boolean expression given a set of values assigned to variables.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean evaluate​(java.util.Map<java.lang.String,​java.lang.Object> env)
      Evaluates the (given) expression with the environment given.
      boolean evaluatorOk()
      This call is idempotent.
      java.lang.String getErrorMessage()
      This call is idempotent.
    • Method Detail

      • evaluate

        boolean evaluate​(java.util.Map<java.lang.String,​java.lang.Object> env)
        Evaluates the (given) expression with the environment given. This call should not fail, provided evaluatorOk() is true.
        Parameters:
        env - - the values of the variables used when evaluating the expression
        Returns:
        the evaluated result: true or false
      • evaluatorOk

        boolean evaluatorOk()
        This call is idempotent.
        Returns:
        true if the evaluator can run cleanly; false otherwise
      • getErrorMessage

        java.lang.String getErrorMessage()
        This call is idempotent.
        Returns:
        null if evaluatorOk() is false; otherwise an error message denoting the type of failure to initialise.