public final class DoubleSummary extends Object implements Serializable
DoubleSummaryStatistics
,
Serialized FormModifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
long |
getCount()
Returns the count of values recorded.
|
double |
getMax()
Return the maximum value recorded, or
Double.NEGATIVE_INFINITY if
no values have been recorded. |
double |
getMean()
Return the arithmetic mean of values recorded, or zero if no values have
been recorded.
|
double |
getMin()
Return the minimum value recorded, or
Double.POSITIVE_INFINITY if
no values have been recorded. |
double |
getSum()
Return the sum of values recorded, or zero if no values have been
recorded.
|
int |
hashCode() |
static DoubleSummary |
of(DoubleSummaryStatistics statistics)
Return a new value object of the statistical summary, currently
represented by the
statistics object. |
static DoubleSummary |
of(long count,
double min,
double max,
double sum,
double mean)
Create an immutable object which contains statistical summary values.
|
static <T> Collector<T,?,DoubleSummary> |
toDoubleSummary(ToDoubleFunction<? super T> mapper)
Return a
Collector which applies an double-producing mapping
function to each input element, and returns summary-statistics for the
resulting values. |
String |
toString() |
public long getCount()
public double getMin()
Double.POSITIVE_INFINITY
if
no values have been recorded.Double.POSITIVE_INFINITY
if nonepublic double getMax()
Double.NEGATIVE_INFINITY
if
no values have been recorded.Double.NEGATIVE_INFINITY
if nonepublic double getSum()
public double getMean()
public static DoubleSummary of(long count, double min, double max, double sum, double mean)
count
- the count of values recordedmin
- the minimum valuemax
- the maximum valuesum
- the sum of the recorded valuesmean
- the arithmetic mean of valuespublic static DoubleSummary of(DoubleSummaryStatistics statistics)
statistics
object.statistics
- the creating (mutable) statistics classpublic static <T> Collector<T,?,DoubleSummary> toDoubleSummary(ToDoubleFunction<? super T> mapper)
Collector
which applies an double-producing mapping
function to each input element, and returns summary-statistics for the
resulting values.
final Stream<SomeObject> stream = ...
final DoubleSummary summary = stream
.collect(toDoubleSummary(v -> v.doubleValue()));
T
- the type of the input elementsmapper
- a mapping function to apply to each elementCollector
implementing the summary-statistics reductionNullPointerException
- if the given mapper
is
null
© 2007-2017 Franz Wilhelmstötter (2017-04-28 16:50)