Class IntStatistics.Builder

java.lang.Object
org.apache.commons.statistics.descriptive.IntStatistics.Builder
Enclosing class:
IntStatistics

public static final class IntStatistics.Builder extends Object
A builder for IntStatistics.
  • Field Details

  • Constructor Details

    • Builder

      Builder()
      Create an instance.
  • Method Details

    • add

      Add the statistic to the statistics to compute.
      Parameters:
      statistic - Statistic to compute.
      Returns:
      this instance
    • createMoment

      private void createMoment(int order)
      Creates the moment constructor for the specified order, e.g. order=3 is sum of cubed deviations.
      Parameters:
      order - Order.
    • setConfiguration

      public IntStatistics.Builder setConfiguration(StatisticsConfiguration v)
      Sets the statistics configuration options for computation of statistics.
      Parameters:
      v - Value.
      Returns:
      the builder
      Throws:
      NullPointerException - if the value is null
    • build

      public IntStatistics build()
      Builds a IntStatistics instance.
      Returns:
      IntStatistics instance.
    • build

      public IntStatistics build(int... values)
      Builds a IntStatistics instance using the input values.

      Note: IntStatistics computed using accept may be different from this instance.

      Parameters:
      values - Values.
      Returns:
      IntStatistics instance.
    • create

      private static <T> T create(Function<int[],T> constructor, int[] values)
      Creates the object from the values.
      Type Parameters:
      T - object type
      Parameters:
      constructor - Constructor.
      values - Values
      Returns:
      the instance