org.translet.processor
Interface PredicateExpr

All Known Implementing Classes:
SimplePredicateExpr, CompoundPredicateExpr

public interface PredicateExpr

Composite interface that represents the expression in the predicate

Author:
Karthikeyan M.

Method Summary
 Object evaluate()
          Evaluates the expression and returns the value.
 boolean initialize(PredicateContext context, RuleMonitor rules)
          Initializes and validates (recursively, if required) the expression and returns the status about if the expression can be evaluated.
 

Method Detail

initialize

public boolean initialize(PredicateContext context,
                          RuleMonitor rules)
Initializes and validates (recursively, if required) the expression and returns the status about if the expression can be evaluated.

The values passed on the contextNode and the rules are also the values that are to be used in evaluating the expression.

The expression is expected to return at the first place where the initialization fails. In other words, if the initialization succeeds, all the expressions were initialized, but, if it fails, not all expressions might have been evaluated.

Parameters:
context - The context for this expression.
rules - Required to make decisions when the expression is ambiguous. null, if there are no rules required.
Returns:
true if the expression can be evaluated within the context of the rules specified.

evaluate

public Object evaluate()
Evaluates the expression and returns the value.
Returns:
The value for this expression.