Class RangeCompareBase<T extends FeatureInput>

Type Parameters:
T - the type of FeatureInput this feature operates on
Direct Known Subclasses:
CompareWithRangeFeature, RangeCompareFromScalars

public abstract class RangeCompareBase<T extends FeatureInput> extends FeatureUnaryGeneric<T>
A base class for features that compare a value against a range and return different results based on the comparison.
  • Constructor Details

    • RangeCompareBase

      public RangeCompareBase()
  • Method Details

    • calculate

      public double calculate(FeatureCalculationInput<T> input) throws FeatureCalculationException
      Description copied from class: Feature
      Calculates a value for some input.
      Specified by:
      calculate in class Feature<T extends FeatureInput>
      Parameters:
      input - the input to the calculation.
      Returns:
      the result of the calculation.
      Throws:
      FeatureCalculationException - if the calculation cannot successfully complete.
    • boundaryMin

      protected abstract double boundaryMin(FeatureCalculationInput<T> input) throws FeatureCalculationException
      Defines the minimum accepted value in the range.
      Parameters:
      input - the FeatureCalculationInput to use for calculation
      Returns:
      the minimum boundary value
      Throws:
      FeatureCalculationException - if the calculation fails
    • boundaryMax

      protected abstract double boundaryMax(FeatureCalculationInput<T> input) throws FeatureCalculationException
      Defines the maximum accepted value in the range.
      Parameters:
      input - the FeatureCalculationInput to use for calculation
      Returns:
      the maximum boundary value
      Throws:
      FeatureCalculationException - if the calculation fails
    • featureToCalcInputValue

      protected abstract Feature<T> featureToCalcInputValue()
      Specifies which feature to calculate the input value.
      Returns:
      the Feature used to calculate the input value
    • withinRangeValue

      protected abstract double withinRangeValue(double valWithinRange, FeatureCalculationInput<T> input) throws FeatureCalculationException
      Calculates the value to return if the input is within the range.
      Parameters:
      valWithinRange - the input value that is within the range
      input - the FeatureCalculationInput to use for calculation
      Returns:
      the calculated value
      Throws:
      FeatureCalculationException - if the calculation fails
    • describeParameters

      public String describeParameters()
      Description copied from class: Feature
      A human-readable description of the parameterization of the bean.
      Overrides:
      describeParameters in class Feature<T extends FeatureInput>
      Returns:
      the description.
    • getBelowMinValue

      public double getBelowMinValue()
      Constant to return if outside the range (below the minimum allowed)
    • setBelowMinValue

      public void setBelowMinValue(double belowMinValue)
      Constant to return if outside the range (below the minimum allowed)
    • getAboveMaxValue

      public double getAboveMaxValue()
      Constant to return if outside the range (above the maximum allowed)
    • setAboveMaxValue

      public void setAboveMaxValue(double aboveMaxValue)
      Constant to return if outside the range (above the maximum allowed)