java.lang.Object
adaa.analytics.rules.logic.representation.condition.ConditionBase
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
CompoundCondition, ElementaryCondition

public abstract class ConditionBase extends Object implements Cloneable, Serializable
Abstract base class representing all conditions.
See Also:
  • Field Details

    • disabled

      protected boolean disabled
      Flag indicating if condition is disabled.
    • type

      protected ConditionBase.Type type
      Condition type.
    • covering

      protected IntegerBitSet covering
      Optional integer bit set for storing condition coverage.
  • Constructor Details

    • ConditionBase

      public ConditionBase()
  • Method Details

    • isDisabled

      public boolean isDisabled()
    • setDisabled

      public void setDisabled(boolean b)
    • getType

      public ConditionBase.Type getType()
      Gets type
    • setType

      public void setType(ConditionBase.Type t)
      Sets type
    • getCovering

      public IntegerBitSet getCovering()
      Gets covering.
    • setCovering

      public void setCovering(IntegerBitSet c)
      Sets covering.
    • isPrunable

      public boolean isPrunable()
      Check whether the condition is prunable (non-FORCED and non-PREFERRED).
      Returns:
      Value indicating whether condition is prunable.
    • evaluate

      public boolean evaluate(Example ex)
      Evaluates the condition on a given example. It verifies disabled flag and calls internalEvaluate(adaa.analytics.rules.data.row.Example) abstract method.
      Parameters:
      ex - Example to be examined.
      Returns:
      Logical value indicating whether the example fulfills the condition.
    • evaluate

      public void evaluate(IExampleSet set, Set<Integer> outIndices)
      Evaluates the condition on a specified dataset. It verifies disabled flag and calls internalEvaluate(adaa.analytics.rules.data.row.Example) abstract method.
      Parameters:
      set - Input dataset.
      outIndices - Output set of indices covered by the condition.
    • equals

      public abstract boolean equals(Object ref)
      Verifies whether the condition is equal to another one.
      Overrides:
      equals in class Object
      Parameters:
      ref - Reference object.
      Returns:
      Logical value indicating whether conditions are equal.
    • getAttributes

      public abstract Set<String> getAttributes()
      Gets a collection of attributes the condition is built upon.
      Returns:
      Set of attributes.
    • internalEvaluate

      protected abstract boolean internalEvaluate(Example ex)
      Evaluates the condition on a given example.
      Parameters:
      ex - Example to be examined.
      Returns:
      Logical value indicating whether the example fulfills the condition.
    • internalEvaluate

      protected abstract void internalEvaluate(IExampleSet set, Set<Integer> outIndices)
      Evaluates the condition on a specified dataset.
      Parameters:
      set - Input dataset.
      outIndices - Output set of indices covered by the condition.
    • clone

      public abstract ConditionBase clone()
      Overrides:
      clone in class Object