Class FeatureHistogramStatistic

Direct Known Subclasses:
Mean

public abstract class FeatureHistogramStatistic extends FeatureHistogram
Base class for FeatureHistogram implementations that calculate a statistic from the Histogram.
Author:
Owen Feehan
  • Constructor Details

    • FeatureHistogramStatistic

      public FeatureHistogramStatistic()
  • Method Details

    • calculate

    • calculateStatisticFrom

      protected abstract double calculateStatisticFrom(Histogram histogram) throws FeatureCalculationException
      Calculates the statistic from the histogram, that is subsequently returned as the feature-value.
      Parameters:
      histogram - the histogram to calculate the statistic from.
      Returns:
      the calculated statistic.
      Throws:
      FeatureCalculationException - if the calculation cannot succeed.
    • isExceptionIfEmpty

      public boolean isExceptionIfEmpty()
      If true, then an exception is thrown if the histogram is empty, otherwise valueIfEmpty is returned.
    • setExceptionIfEmpty

      public void setExceptionIfEmpty(boolean exceptionIfEmpty)
      If true, then an exception is thrown if the histogram is empty, otherwise valueIfEmpty is returned.
    • getValueIfEmpty

      public double getValueIfEmpty()
      The value to return iff exceptionifEmpty is false.
    • setValueIfEmpty

      public void setValueIfEmpty(double valueIfEmpty)
      The value to return iff exceptionifEmpty is false.