Class Constant<T extends FeatureInput>

Type Parameters:
T - the input-type (even though it is irrelevant and ignored, but it keeps the class hierarchy consistent).

public class Constant<T extends FeatureInput> extends FeatureGeneric<T>
A constant value that is entirely invariant to the feature-input.
Author:
Owen Feehan
  • Constructor Details

    • Constant

      public Constant(double value)
      Constructor with a particular value.
      Parameters:
      value - the value.
    • Constant

      public Constant(String customName, double value)
      Constructor with a particular value and a custom-name.
      Parameters:
      customName - a custom-name for feature.
      value - the value.
    • Constant

      public Constant()
  • Method Details

    • calculate

      public double calculate(FeatureCalculationInput<T> input)
      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.
    • 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.
    • 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.
    • getValue

      public double getValue()
      The constant value.
    • setValue

      public void setValue(double value)
      The constant value.