public abstract class AbstractRule extends java.lang.Object implements IRule
Modifier and Type | Field and Description |
---|---|
private java.util.Collection<TypedPreference<?>> |
configAttributes |
protected java.util.concurrent.FutureTask<Result> |
evaluationTask |
private java.lang.String |
id |
private java.lang.String |
name |
private java.lang.String |
topic |
Constructor and Description |
---|
AbstractRule(java.lang.String id,
java.lang.String name,
java.lang.String topic,
TypedPreference<?>... configAttributes) |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.RunnableFuture<Result> |
evaluate(IItemCollection items,
IPreferenceValueProvider valueProvider)
Gets a future representing the result of the evaluation of this rule.
|
java.util.Collection<TypedPreference<?>> |
getConfigurationAttributes()
Gets information about which attributes may be configured during rule evaluation.
|
java.lang.String |
getId() |
java.lang.String |
getName() |
protected abstract Result |
getResult(IItemCollection items,
IPreferenceValueProvider vp) |
java.lang.String |
getTopic() |
protected java.util.concurrent.FutureTask<Result> evaluationTask
private final java.lang.String id
private final java.lang.String name
private final java.lang.String topic
private final java.util.Collection<TypedPreference<?>> configAttributes
public AbstractRule(java.lang.String id, java.lang.String name, java.lang.String topic, TypedPreference<?>... configAttributes)
protected abstract Result getResult(IItemCollection items, IPreferenceValueProvider vp)
public java.util.concurrent.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 java.util.Collection<TypedPreference<?>> getConfigurationAttributes()
IRule
getConfigurationAttributes
in interface IRule
public java.lang.String getId()
public java.lang.String getName()