Interface LongStatisticResult
- All Superinterfaces:
DoubleSupplier
,IntSupplier
,LongSupplier
,StatisticResult
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
long
result of a statistic computed over a set of values.
This is a helper interface to map the native type of the expected value to other result types.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptiondefault BigInteger
Gets a result as aBigInteger
.default double
default int
getAsInt()
long
-
Method Details
-
getAsLong
long getAsLong()Description copied from interface:StatisticResult
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
- Specified by:
getAsLong
in interfaceStatisticResult
-
getAsDouble
default double getAsDouble()- Specified by:
getAsDouble
in interfaceDoubleSupplier
-
getAsInt
default int getAsInt()Description copied from interface:StatisticResult
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
- Specified by:
getAsInt
in interfaceStatisticResult
-
getAsBigInteger
Description copied from interface:StatisticResult
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.- Specified by:
getAsBigInteger
in interfaceStatisticResult
- Returns:
- a result
-