public interface DoubleStatistics
| Modifier and Type | Method and Description |
|---|---|
void |
accept(double value)
Records another value into the summary information.
|
double |
getAverage()
Returns the arithmetic mean of values recorded, or zero if no values have
been recorded.
|
long |
getCount()
Return the count of values recorded.
|
double |
getMax()
Returns the maximum recorded value,
Double.NaN if any recorded
value was NaN or Double.NEGATIVE_INFINITY if no values were
recorded. |
double |
getMin()
Returns the minimum recorded value,
Double.NaN if any recorded
value was NaN or Double.POSITIVE_INFINITY if no values were
recorded. |
double |
getStandardDeviation() |
double |
getSum()
Returns the sum of values recorded, or zero if no values have been
recorded.
|
double |
getVariance() |
static DoubleStatistics |
newInstance()
Creates a new non-threadsafe
DoubleStatistics instance. |
static DoubleStatistics |
newInstance(boolean threadsafe)
Creates a new
DoubleStatistics instance which, depending on the
threadsafe argument, is either threadsafe or non-threadsafe. |
String |
toString()
Returns a non-empty string representation of this object suitable for
debugging.
|
static DoubleStatistics newInstance()
DoubleStatistics instance.DoubleStatistics instancestatic DoubleStatistics newInstance(boolean threadsafe)
DoubleStatistics instance which, depending on the
threadsafe argument, is either threadsafe or non-threadsafe.threadsafe - if true a threadsafe DoubleStatistics gets
createdDoubleStatistics instance which is either
threadsafe or non-threadsafe (depending on the value of the
threadsafe argument)void accept(double value)
value - the input valuelong getCount()
double getSum()
The value of a floating-point sum is a function both of the input values
as well as the order of addition operations. The order of addition
operations of this method is intentionally not defined to allow for
implementation flexibility to improve the speed and accuracy of the
computed result.
In particular, this method may be implemented using compensated summation
or other technique to reduce the error bound in the numerical sum
compared to a simple summation of double values. Because of the
unspecified order of operations and the possibility of using differing
summation schemes, the output of this method may vary on the same input
values.
Various conditions can result in a non-finite sum being computed. This can occur even if the all the recorded values being summed are finite. If any recorded value is non-finite, the sum will be non-finite:
API Note:
Values sorted by increasing absolute magnitude tend to yield more
accurate results.
double getMin()
Double.NaN if any recorded
value was NaN or Double.POSITIVE_INFINITY if no values were
recorded. Unlike the numerical comparison operators, this method
considers negative zero to be strictly smaller than positive zero.Double.NaN if any recorded
value was NaN or Double.POSITIVE_INFINITY if no values
were recordeddouble getMax()
Double.NaN if any recorded
value was NaN or Double.NEGATIVE_INFINITY if no values were
recorded. Unlike the numerical comparison operators, this method
considers negative zero to be strictly smaller than positive zero.Double.NaN if any recorded
value was NaN or Double.NEGATIVE_INFINITY if no values
were recordeddouble getAverage()
The computed average can vary numerically and have the special case
behavior as computing the sum; see getSum() for details.
API Note:
Values sorted by increasing absolute magnitude tend to yield more
accurate results.
double getVariance()
double getStandardDeviation()
Copyright © 2021. All rights reserved.