Interface IRule

All Known Implementing Classes:
AbstractRule

public interface IRule
Rules are used for analyzing flight recordings and creating results that can inform a user about problems.

The key method to implement is createEvaluation(IItemCollection, IPreferenceValueProvider, IResultValueProvider). getId() must return an id that is unique for each implementation and getName() should return a human readable name.

Rule instances may be reused for multiple evaluations with different input data so it is strongly recommended that implementations be stateless.

  • Method Details

    • getId

      String getId()
      Returns:
      a unique id for this rule implementation
    • getTopic

      String getTopic()
      Returns:
      the topic for this rule, may be null
    • getName

      String getName()
      Returns:
      a human readable name for this rule
    • getRequiredEvents

      Returns:
      a map of all event type IDs and the minimum RulesToolkit.EventAvailability this rule requires for that event type
    • createEvaluation

      RunnableFuture<IResult> createEvaluation(IItemCollection items, IPreferenceValueProvider preferenceValueProvider, IResultValueProvider dependencyResults)
      Gets a future representing the result of the evaluation of this rule. Running the RunnableFuture is the responsibility of the caller of this method, not the implementation.
      Parameters:
      items - items to evaluate
      preferenceValueProvider - Provider of configuration values used for evaluation. The attributes that will be asked for from the provider should be provided by getConfigurationAttributes().
      dependencyResults - Provider of results from rules evaluated prior to this rule and which this rule explicitly depends on via a DependsOn annotation. The attributes that will be asked for from the provider will be provided by each dependant rule, e.g. via public static constants.
      Returns:
      a RunnableFuture that when run will return the evaluation result
    • getConfigurationAttributes

      Collection<TypedPreference<?>> getConfigurationAttributes()
      Gets information about which attributes may be configured during rule evaluation.
      Returns:
      a list of configuration attributes
    • getResults

      Collection<TypedResult<?>> getResults()
      Gets information about which results may be part of an IResult instance.
      Returns:
      a list of result attributes