public interface EvaluatorsContext
A collection of every condition tha was ever used in the engine's runtime. It allows developers
to register an Evaluator and use its EvaluatorHandle to later update the supplied
condition.
| Modifier and Type | Method and Description |
|---|---|
default EvaluatorHandle |
addEvaluator(Evaluator evaluator) |
EvaluatorHandle |
addEvaluator(Evaluator evaluator,
double complexity)
Registers new condition evaluator and returns its handle.
|
Evaluator |
getEvaluator(EvaluatorHandle handle)
Returns evaluator by its handle.
|
void |
replaceEvaluator(EvaluatorHandle handle,
Evaluator newEvaluator)
Replaces existing condition with a new one.
|
void |
replaceEvaluator(EvaluatorHandle handle,
ValuesPredicate predicate)
Replaces existing condition with a new one.
|
EvaluatorHandle addEvaluator(Evaluator evaluator, double complexity)
Registers new condition evaluator and returns its handle. If an existing Evaluator
matches the argument (Evaluator.compare(Evaluator) returns Evaluator.RELATION_EQUALS),
the existing evaluator handle will be returned instead and no changes will be made in the
context.
evaluator - condition to addcomplexity - condition's relative complexityEvaluatorHandle or the one of an existing condition.Evaluator getEvaluator(EvaluatorHandle handle)
Returns evaluator by its handle.
handle - evaluator handledefault EvaluatorHandle addEvaluator(Evaluator evaluator)
evaluator - condition to addEvaluatorHandle or the one of an existing condition.addEvaluator(Evaluator, double)void replaceEvaluator(EvaluatorHandle handle, Evaluator newEvaluator)
Replaces existing condition with a new one. New condition must have
the same Evaluator.descriptor(), otherwise IllegalArgumentException
will be thrown.
handle - handle of an existing conditionnewEvaluator - new conditionIllegalArgumentException - if no condition can be found by the given handle or
if the existing condition's descriptor does not match the new one.void replaceEvaluator(EvaluatorHandle handle, ValuesPredicate predicate)
Replaces existing condition with a new one.
handle - handle of an existing conditionpredicate - new condition in a form if ValuesPredicateCopyright © 2021. All rights reserved.