Interface StatisticResult

All Superinterfaces:
DoubleSupplier, IntSupplier, LongSupplier
All Known Subinterfaces:
BigIntegerStatisticResult, DoubleStatistic, IntStatistic, IntStatisticResult, LongStatistic, LongStatisticResult
All Known Implementing Classes:
GeometricMean, IntMax, IntMean, IntMin, IntStandardDeviation, IntSum, IntSumOfSquares, IntVariance, Kurtosis, LongMax, LongMean, LongMin, LongStandardDeviation, LongSum, LongSumOfSquares, LongVariance, Max, Mean, Min, Product, Skewness, StandardDeviation, Sum, SumOfLogs, SumOfSquares, Variance
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface StatisticResult extends DoubleSupplier, IntSupplier, LongSupplier
Represents the result of a statistic computed over a set of values.

Base interface implemented by all statistics.

Since:
1.1
  • Method Details

    • getAsInt

      default int getAsInt()

      The default implementation uses the closest representable int value of the DoubleSupplier.getAsDouble() result. In the event of ties the result is rounded towards positive infinity. This will raise an ArithmeticException if the closest integer result is not within the range [-2^31, 2^31).

      Specified by:
      getAsInt in interface IntSupplier
      Throws:
      ArithmeticException - if the result overflows an int or is not finite
    • getAsLong

      default long getAsLong()

      The default implementation uses the closest representable long value of the DoubleSupplier.getAsDouble() result. In the event of ties the result is rounded towards positive infinity. This will raise an ArithmeticException if the closest integer result is not within the range [-2^63, 2^63).

      Specified by:
      getAsLong in interface LongSupplier
      Throws:
      ArithmeticException - if the result overflows a long or is not finite
    • getAsBigInteger

      default BigInteger getAsBigInteger()
      Gets a result as a BigInteger.

      The default implementation uses the closest representable BigInteger value of the DoubleSupplier.getAsDouble() result. In the event of ties the result is rounded towards positive infinity. This will raise an ArithmeticException if the result is not finite.

      Returns:
      a result
      Throws:
      ArithmeticException - if the result is not finite