public final class IntSummary extends Object implements Serializable
IntSummaryStatistics
,
Serialized FormModifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
long |
getCount()
Returns the count of values recorded.
|
int |
getMax()
Return the maximum value recorded, or
Integer.MIN_VALUE if no
values have been recorded. |
double |
getMean()
Return the arithmetic mean of values recorded, or zero if no values have
been recorded.
|
int |
getMin()
Return the minimum value recorded, or
Integer.MAX_VALUE if no
values have been recorded. |
long |
getSum()
Return the sum of values recorded, or zero if no values have been
recorded.
|
int |
hashCode() |
static IntSummary |
of(IntSummaryStatistics statistics)
Return a new value object of the statistical summary, currently
represented by the
statistics object. |
static IntSummary |
of(long count,
int min,
int max,
long sum,
double mean)
Create an immutable object which contains statistical summary values.
|
static <T> Collector<T,?,IntSummary> |
toIntSummary(ToIntFunction<? super T> mapper)
Return a
Collector which applies an int-producing mapping
function to each input element, and returns summary-statistics for the
resulting values. |
String |
toString() |
public long getCount()
public int getMin()
Integer.MAX_VALUE
if no
values have been recorded.Integer.MAX_VALUE
if nonepublic int getMax()
Integer.MIN_VALUE
if no
values have been recorded.Integer.MIN_VALUE
if nonepublic long getSum()
public double getMean()
public static IntSummary of(long count, int min, int max, long 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 IntSummary of(IntSummaryStatistics statistics)
statistics
object.statistics
- the creating (mutable) statistics classpublic static <T> Collector<T,?,IntSummary> toIntSummary(ToIntFunction<? super T> mapper)
Collector
which applies an int-producing mapping
function to each input element, and returns summary-statistics for the
resulting values.
final Stream<SomeObject> stream = ...
final IntSummary summary = stream
.collect(toIntSummary(v -> v.intValue()));
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)