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.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 java.math.BigInteger
getAsBigInteger()
Gets a result as aBigInteger
.default int
getAsInt()
default long
getAsLong()
-
-
-
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 interfacejava.util.function.IntSupplier
- Throws:
java.lang.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 interfacejava.util.function.LongSupplier
- Throws:
java.lang.ArithmeticException
- if theresult
overflows along
or is not finite
-
getAsBigInteger
default java.math.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:
java.lang.ArithmeticException
- if theresult
is not finite
-
-