public final class IntSummary extends Object implements Serializable
IntSummaryStatistics
,
Serialized FormModifier and Type | Method and Description |
---|---|
long |
count()
Returns the count of values recorded.
|
boolean |
equals(Object obj) |
long |
getCount()
Deprecated.
Use
count() instead |
int |
getMax()
Deprecated.
Use
max() instead |
double |
getMean()
Deprecated.
Use
mean() instead |
int |
getMin()
Deprecated.
Use
min() instead |
long |
getSum()
Deprecated.
Use
sum() instead |
int |
hashCode() |
int |
max()
Return the maximum value recorded, or
Integer.MIN_VALUE if no
values have been recorded. |
static int |
max(int[] values)
Return the maximum value of the given double array.
|
double |
mean()
Return the arithmetic mean of values recorded, or zero if no values have
been recorded.
|
static double |
mean(int[] values)
Returns a double describing the arithmetic mean of the values, or
Double.NaN if the values array is empty. |
int |
min()
Return the minimum value recorded, or
Integer.MAX_VALUE if no
values have been recorded. |
static int |
min(int[] values)
Return the minimum value of the given double array.
|
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.
|
long |
sum()
Return the sum of values recorded, or zero if no values have been
recorded.
|
static long |
sum(int[] values)
Return the sum of the given double array.
|
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 count()
@Deprecated public long getCount()
count()
insteadpublic int min()
Integer.MAX_VALUE
if no
values have been recorded.Integer.MAX_VALUE
if none@Deprecated public int getMin()
min()
insteadInteger.MAX_VALUE
if no
values have been recorded.Integer.MAX_VALUE
if nonepublic int max()
Integer.MIN_VALUE
if no
values have been recorded.Integer.MIN_VALUE
if none@Deprecated public int getMax()
max()
insteadInteger.MIN_VALUE
if no
values have been recorded.Integer.MIN_VALUE
if nonepublic long sum()
@Deprecated public long getSum()
sum()
insteadpublic double mean()
@Deprecated public double getMean()
mean()
insteadpublic 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
public static int min(int[] values)
values
- the array.Integer.MAX_VALUE
if the given array is
empty.NullPointerException
- if the given array is null
.public static int max(int[] values)
values
- the array.Integer.MIN_VALUE
if the given array is
empty.NullPointerException
- if the given array is null
.public static long sum(int[] values)
values
- the values to sum up.values
.NullPointerException
- if the given array is null
.public static double mean(int[] values)
Double.NaN
if the values
array is empty.values
- the values to calculate the mean ofvalues
or
Double.NaN
if the values
array is emptyNullPointerException
- if the given array is null
.© 2007-2020 Franz Wilhelmstötter (2020-02-18 20:01)