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 BigInteger
getAsBigInteger()
Gets a result as aBigInteger
.default int
getAsInt()
default long
getAsLong()
-
Methods inherited from interface java.util.function.DoubleSupplier
getAsDouble
-
-
-
-
Method Detail
-
getAsInt
default int getAsInt()
The default implementation uses the closest representable
int
value of theDoubleSupplier.getAsDouble()
result
. In the event of ties the result is rounded towards positive infinity. This will raise anArithmeticException
if the closest integer result is not within the range[-2^31, 2^31)
.- Specified by:
getAsInt
in interfaceIntSupplier
- Throws:
ArithmeticException
- if theresult
overflows anint
or is not finite
-
getAsLong
default long getAsLong()
The default implementation uses the closest representable
long
value of theDoubleSupplier.getAsDouble()
result
. In the event of ties the result is rounded towards positive infinity. This will raise anArithmeticException
if the closest integer result is not within the range[-2^63, 2^63)
.- Specified by:
getAsLong
in interfaceLongSupplier
- Throws:
ArithmeticException
- if theresult
overflows along
or is not finite
-
getAsBigInteger
default BigInteger getAsBigInteger()
Gets a result as aBigInteger
.The default implementation uses the closest representable
BigInteger
value of theDoubleSupplier.getAsDouble()
result
. In the event of ties the result is rounded towards positive infinity. This will raise anArithmeticException
if theresult
is not finite.- Returns:
- a result
- Throws:
ArithmeticException
- if theresult
is not finite
-
-