public class LongMomentStatistics extends Object implements LongConsumer, IntConsumer
LongSummaryStatistics class.
 This class is designed to work with (though does not require) streams. For example, you can compute moments-statistics on a stream of longs with:
 final LongStream stream = ...
 final LongMomentStatistics statistics = stream.collect(
         LongMomentStatistics::new,
         LongMomentStatistics::accept,
         LongMomentStatistics::combine
     );
 final Stream<SomeObject> stream = ...
 final LongMomentStatistics statistics = stream
     .collect(toLongMomentStatistics(v -> v.longValue()));
 Implementation note:
 This implementation is not thread safe. However, it is safe to use
 toLongMomentStatistics(ToLongFunction)  on a parallel stream, because the parallel
 implementation of Stream.collect()
 provides the necessary partitioning, isolation, and merging of results for
 safe and efficient parallel execution.
LongSummaryStatistics, 
LongMoments, 
      Computing Higher-Order Moments Online| Constructor and Description | 
|---|
| LongMomentStatistics()Create an empty moments object. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | accept(int value)Records a new value into the moments information | 
| void | accept(long value)Records a new value into the moments information | 
| LongMomentStatistics | combine(LongMomentStatistics other)Combine two  LongMomentsstatistic objects. | 
| long | getCount()Returns the count of values recorded. | 
| double | getKurtosis()Return the kurtosis of values recorded, or  Double.NaNif less
 than four values have been recorded. | 
| long | getMax()Return the maximum value recorded, or  Long.MIN_VALUEif no
 values have been recorded. | 
| double | getMean()Return the arithmetic mean of values recorded, or  Double.NaNif
 no values have been recorded. | 
| long | getMin()Return the minimum value recorded, or  Long.MAX_VALUEif no
 values have been recorded. | 
| double | getSkewness()Return the skewness of values recorded, or  Double.NaNif less
 than two values have been recorded. | 
| long | getSum()Return the sum of values recorded, or zero if no values have been
 recorded. | 
| double | getVariance()Return the variance of values recorded, or  Double.NaNif no
 values have been recorded. | 
| static <T> Collector<T,?,LongMomentStatistics> | toLongMomentStatistics(ToLongFunction<? super T> mapper)Return a  Collectorwhich applies an long-producing mapping
 function to each input element, and returns moments-statistics for the
 resulting values. | 
| String | toString() | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitandThenandThenpublic LongMomentStatistics()
public void accept(long value)
accept in interface LongConsumervalue - the input valuepublic void accept(int value)
accept in interface IntConsumervalue - the input valuepublic LongMomentStatistics combine(LongMomentStatistics other)
LongMoments statistic objects.other - the other LongMoments statistics to combine with
        this one.this statistics objectNullPointerException - if the other statistical summary
         is null.public long getMin()
Long.MAX_VALUE if no
 values have been recorded.Long.MAX_VALUE if nonepublic long getMax()
Long.MIN_VALUE if no
 values have been recorded.Long.MIN_VALUE if nonepublic long getSum()
public static <T> Collector<T,?,LongMomentStatistics> toLongMomentStatistics(ToLongFunction<? super T> mapper)
Collector which applies an long-producing mapping
 function to each input element, and returns moments-statistics for the
 resulting values.
 
 final Stream<SomeObject> stream = ...
 final LongMomentStatistics statistics = stream
     .collect(toLongMomentStatistics(v -> v.longValue()));T - the type of the input elementsmapper - a mapping function to apply to each elementCollector implementing the moments-statistics reductionNullPointerException - if the given mapper is
         nullpublic long getCount()
public double getMean()
Double.NaN if
 no values have been recorded.public double getVariance()
Double.NaN if no
 values have been recorded.NaN if nonepublic double getSkewness()
Double.NaN if less
 than two values have been recorded.NaN if less than two values
         have been recordedpublic double getKurtosis()
Double.NaN if less
 than four values have been recorded.NaN if less than four values
         have been recorded© 2007-2014 Franz Wilhelmstötter (2014-12-28 10:45)