public abstract class AbstractRule extends Object implements IRule
Modifier and Type | Field and Description |
---|---|
protected FutureTask<Result> |
evaluationTask |
Constructor and Description |
---|
AbstractRule(String id,
String name,
String topic,
TypedPreference<?>... configAttributes) |
Modifier and Type | Method and Description |
---|---|
RunnableFuture<Result> |
evaluate(IItemCollection items,
IPreferenceValueProvider valueProvider)
Gets a future representing the result of the evaluation of this rule.
|
Collection<TypedPreference<?>> |
getConfigurationAttributes()
Gets information about which attributes may be configured during rule evaluation.
|
String |
getId() |
String |
getName() |
protected abstract Result |
getResult(IItemCollection items,
IPreferenceValueProvider vp) |
String |
getTopic() |
protected FutureTask<Result> evaluationTask
public AbstractRule(String id, String name, String topic, TypedPreference<?>... configAttributes)
protected abstract Result getResult(IItemCollection items, IPreferenceValueProvider vp)
public RunnableFuture<Result> evaluate(IItemCollection items, IPreferenceValueProvider valueProvider)
IRule
evaluate
in interface IRule
items
- items to evaluatevalueProvider
- Provider of configuration values used for evaluation. The attributes that will be
asked for from the provider should be provided by
IRule.getConfigurationAttributes()
.public Collection<TypedPreference<?>> getConfigurationAttributes()
IRule
getConfigurationAttributes
in interface IRule
public String getId()
public String getName()
Copyright © 2020. All rights reserved.