Package de.jungblut.utils
Class Statistics
- java.lang.Object
-
- de.jungblut.utils.Statistics
-
- All Implemented Interfaces:
org.apache.hadoop.io.Writable
public final class Statistics extends java.lang.Object implements org.apache.hadoop.io.WritableSmall statistics utility to describe data based on its min/max/mean/median/deviation.- Author:
- thomas.jungblut
-
-
Constructor Summary
Constructors Constructor Description Statistics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double item)Adds a new data item into the current statistics object.voidfinalizeComputation()Finalize the computation to calculate the mean/median and deviation.doublegetCoefficientOfVariation()intgetCount()doublegetDispersionIndex()doublegetMax()doublegetMean()doublegetMedian()doublegetMin()doublegetSignalToNoise()doublegetStandardDeviation()doublegetSum()doublegetVariance()voidreadFields(java.io.DataInput in)java.lang.StringtoString()voidwrite(java.io.DataOutput out)
-
-
-
Method Detail
-
add
public void add(double item)
Adds a new data item into the current statistics object.- Parameters:
item- a normal double value.
-
finalizeComputation
public void finalizeComputation()
Finalize the computation to calculate the mean/median and deviation.
-
write
public void write(java.io.DataOutput out) throws java.io.IOException- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
java.io.IOException
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
java.io.IOException
-
getMin
public double getMin()
-
getMax
public double getMax()
-
getMedian
public double getMedian()
-
getMean
public double getMean()
-
getStandardDeviation
public double getStandardDeviation()
-
getVariance
public double getVariance()
-
getSignalToNoise
public double getSignalToNoise()
-
getDispersionIndex
public double getDispersionIndex()
-
getCoefficientOfVariation
public double getCoefficientOfVariation()
-
getSum
public double getSum()
-
getCount
public int getCount()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-