-
- All Known Implementing Classes:
SqlEvaluator
public interface EvaluatorAnEvaluatorwill 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 booleanevaluate(java.util.Map<java.lang.String,java.lang.Object> env)Evaluates the (given) expression with theenvironment given.booleanevaluatorOk()This call is idempotent.java.lang.StringgetErrorMessage()This call is idempotent.
-
-
-
Method Detail
-
evaluate
boolean evaluate(java.util.Map<java.lang.String,java.lang.Object> env)
Evaluates the (given) expression with theenvironment given. This call should not fail, providedevaluatorOk()istrue.- 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:
trueif the evaluator can run cleanly;falseotherwise
-
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.
-
-