Interface StatisticResult
-
- All Superinterfaces:
java.util.function.DoubleSupplier,java.util.function.IntSupplier,java.util.function.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 java.util.function.DoubleSupplier, java.util.function.IntSupplier, java.util.function.LongSupplierRepresents the result of a statistic computed over a set of values.Base interface implemented by all statistics.
- Since:
- 1.1
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default java.math.BigIntegergetAsBigInteger()Gets a result as aBigInteger.default intgetAsInt()default longgetAsLong()
-
-
-
Method Detail
-
getAsInt
default int getAsInt()
The default implementation uses the closest representable
intvalue of theDoubleSupplier.getAsDouble()result. In the event of ties the result is rounded towards positive infinity. This will raise anArithmeticExceptionif the closest integer result is not within the range[-2^31, 2^31).- Specified by:
getAsIntin interfacejava.util.function.IntSupplier- Throws:
java.lang.ArithmeticException- if theresultoverflows anintor is not finite
-
getAsLong
default long getAsLong()
The default implementation uses the closest representable
longvalue of theDoubleSupplier.getAsDouble()result. In the event of ties the result is rounded towards positive infinity. This will raise anArithmeticExceptionif the closest integer result is not within the range[-2^63, 2^63).- Specified by:
getAsLongin interfacejava.util.function.LongSupplier- Throws:
java.lang.ArithmeticException- if theresultoverflows alongor is not finite
-
getAsBigInteger
default java.math.BigInteger getAsBigInteger()
Gets a result as aBigInteger.The default implementation uses the closest representable
BigIntegervalue of theDoubleSupplier.getAsDouble()result. In the event of ties the result is rounded towards positive infinity. This will raise anArithmeticExceptionif theresultis not finite.- Returns:
- a result
- Throws:
java.lang.ArithmeticException- if theresultis not finite
-
-