Type Parameters:
T - the type of FeatureInput this feature operates on

public class Divide<T extends FeatureInput> extends FeatureFromList<T>
A feature that divides the results of multiple features sequentially.
  • Constructor Details

    • Divide

      public Divide()
  • 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.
    • descriptionLong

      public String descriptionLong()
      Description copied from class: Feature
      A long human-readable description of the feature and some or all of its parameterization.

      This can be overwritten to create an alternative description for features. By default string returned by Feature.describeBean() is used.

      Overrides:
      descriptionLong in class Feature<T extends FeatureInput>
      Returns:
      the description.
    • isAvoidDivideByZero

      public boolean isAvoidDivideByZero()
      If true, returns a predefined value when division by zero occurs instead of throwing an exception.
    • setAvoidDivideByZero

      public void setAvoidDivideByZero(boolean avoidDivideByZero)
      If true, returns a predefined value when division by zero occurs instead of throwing an exception.
    • getDivideByZeroValue

      public double getDivideByZeroValue()
      The value to return when division by zero occurs and avoidDivideByZero is true.
    • setDivideByZeroValue

      public void setDivideByZeroValue(double divideByZeroValue)
      The value to return when division by zero occurs and avoidDivideByZero is true.