Class PercentileArrayFunction

All Implemented Interfaces:
EventListener, DoubleSource, UpdatableSource

public class PercentileArrayFunction extends AbstractArrayFunction implements DoubleSource
This function calculates percentiles (p1,p5,p10-p90,p95,p99) for a given cross-section of data. Input currently must be doubleArray double[].
  • Field Details

    • p1

      protected double p1
    • p5

      protected double p5
    • p10

      protected double p10
    • p20

      protected double p20
    • p30

      protected double p30
    • p40

      protected double p40
    • p50

      protected double p50
    • p60

      protected double p60
    • p70

      protected double p70
    • p80

      protected double p80
    • p90

      protected double p90
    • p95

      protected double p95
    • p99

      protected double p99
  • Constructor Details

    • PercentileArrayFunction

      public PercentileArrayFunction(@NonNull @NonNull IntArraySource source)
      Creates a percentile function on an integer array source.
      Parameters:
      source - The data source.
      Throws:
      NullPointerException - when source is null.
    • PercentileArrayFunction

      public PercentileArrayFunction(@NonNull @NonNull LongArraySource source)
      Create a percentile function on a long array source.
      Parameters:
      source - The data source.
      Throws:
      NullPointerException - when source is null.
    • PercentileArrayFunction

      public PercentileArrayFunction(@NonNull @NonNull DoubleArraySource source)
      Create a percentile function on a double array source.
      Parameters:
      source - The data source.
      Throws:
      NullPointerException - when source is null.
  • Method Details

    • apply

      public void apply(double @NonNull [] data)
      Applies the function to the given array of double values.
      Overrides:
      apply in class AbstractArrayFunction
      Parameters:
      data - A source array of values.
      Throws:
      NullPointerException - when data is null.
    • apply

      public void apply(int[] data)
      Applies the function to the given array of integer values.
      Overrides:
      apply in class AbstractArrayFunction
      Parameters:
      data - A source array of values.
    • apply

      public void apply(long[] data)
      Applies the function to the given array of long values.
      Overrides:
      apply in class AbstractArrayFunction
      Parameters:
      data - A source array of values.
    • getDoubleValue

      public double getDoubleValue(@NonNull @NonNull Enum<?> variableID)
      Description copied from interface: DoubleSource
      Returns the double value corresponding to the given variableID
      Specified by:
      getDoubleValue in interface DoubleSource
      Parameters:
      variableID - A unique identifier for a variable.
      Returns:
      the actual percentile value.
      Throws:
      NullPointerException - when variableID is null.