Interface StatisticResult
-
- All Superinterfaces:
DoubleSupplier,IntSupplier,LongSupplier
- All Known Subinterfaces:
DoubleStatistic,IntStatistic,LongStatistic
- 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 Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default BigIntegergetAsBigInteger()Gets a result as aBigInteger.default intgetAsInt()default longgetAsLong()-
Methods inherited from interface java.util.function.DoubleSupplier
getAsDouble
-
-
-
-
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 interfaceIntSupplier- Throws:
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 interfaceLongSupplier- Throws:
ArithmeticException- if theresultoverflows alongor is not finite
-
getAsBigInteger
default 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:
ArithmeticException- if theresultis not finite
-
-