org.apache.jorphan.math

Class StatCalculator


public class StatCalculator
extends Object

This class serves as a way to calculate the median of a list of values. It is not threadsafe.

Method Summary

void
addAll(StatCalculator calc)
void
addBytes(long newValue)
void
addValue(Number val)
void
addValue(double newValue)
void
addValue(float newValue)
void
addValue(int newValue)
void
addValue(long newValue)
void
clear()
int
getCount()
HashMap
getDistribution()
The method has a limit of 1% as the finest granularity.
Number
getMax()
double
getMean()
Number
getMedian()
Number
getMin()
Number
getPercentPoint(double percent)
Get the value which %percent% of the values are less than.
Number
getPercentPoint(float percent)
Get the value which %percent% of the values are less than.
double
getStandardDeviation()
long
getTotalBytes()

Method Details

addAll

public void addAll(StatCalculator calc)

addBytes

public void addBytes(long newValue)

addValue

public void addValue(Number val)

addValue

public void addValue(double newValue)

addValue

public void addValue(float newValue)

addValue

public void addValue(int newValue)

addValue

public void addValue(long newValue)

clear

public void clear()

getCount

public int getCount()

getDistribution

public HashMap getDistribution()
The method has a limit of 1% as the finest granularity. We do this to make sure we get a whole number for iterating.

getMax

public Number getMax()

getMean

public double getMean()

getMedian

public Number getMedian()

getMin

public Number getMin()

getPercentPoint

public Number getPercentPoint(double percent)
Get the value which %percent% of the values are less than. This works just like median (where median represents the 50% point). A typical desire is to see the 90% point - the value that 90% of the data points are below, the remaining 10% are above.
Parameters:
percent -
Returns:
number of values less than the percentage

getPercentPoint

public Number getPercentPoint(float percent)
Get the value which %percent% of the values are less than. This works just like median (where median represents the 50% point). A typical desire is to see the 90% point - the value that 90% of the data points are below, the remaining 10% are above.
Parameters:
percent -
Returns:
number of values less than the percentage

getStandardDeviation

public double getStandardDeviation()

getTotalBytes

public long getTotalBytes()

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.