Interface Predicate
- All Known Implementing Classes:
InterpretedUserDefinedPredicate, RepeatInfinitely, SucceedsNeverPredicate, SucceedsOncePredicate, TailRecursivePredicate
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCould the next re-evaluation of this instance succeed?booleanevaluate()Attempts to satisfy the goal this instance represents.
-
Method Details
-
evaluate
boolean evaluate()Attempts to satisfy the goal this instance represents.Calling this method multiple times on a single instance allows all possible answers to be identified. An attempt to find a solution carries on from where the last successful call finished.
If
PredicateFactory.isRetryable()returnsfalsethen this method should only be called once per individual query (no attempt should be made to find alternative solutions).If
PredicateFactory.isRetryable()returnstruethen, in order to find all possible solutions for an individual query, this method should be recalled on backtracking until it returnsfalse.- Returns:
trueif it was possible to satisfy the clause,falseotherwise- See Also:
-
couldReevaluationSucceed
boolean couldReevaluationSucceed()Could the next re-evaluation of this instance succeed?Specifies whether a specific instance of a specific implementation of
Predicate, that has already hadevaluate()called on it at least once, could possibly returntruethe next timeevaluate()is called on it. i.e. is it worth trying to continue to find solutions for the specific query this particular instance represents and has been evaluating?(Note: the difference between this method and
PredicateFactory.isRetryable()is thatPredicateFactory.isRetryable()deals with whether, in general, a specific implementation (rather than instance) ofPredicatecould ever produce multiple answers for an individual query.)- Returns:
trueif an attempt to re-evaluate this instance could possible succeed,falseotherwise
-