|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.core3.util.Average
public class Average
This class is used to compute average (mostly for speed transfer).
Constructor Summary | |
---|---|
protected |
Average(int _refreshRate,
int _period)
Private constructor for an Average |
Method Summary | |
---|---|
void |
addValue(long value)
Public method to add a value to the average, the time it is added is the time this method is called. |
void |
clear()
|
void |
cloneFrom(Average other)
|
long |
getAverage()
This method can be called to get the current average value. |
long |
getAverage(int average_period)
|
double |
getDoubleAverage()
|
String |
getDoubleAverageAsString(int precision)
|
protected long |
getEffectiveTime()
|
static Average |
getInstance(int refreshRate,
int period)
The way to get a new Average Object, it does some parameter checking. |
long |
getPointValue()
|
protected long |
getSum()
|
protected long |
getSum(int slots)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Average(int _refreshRate, int _period)
_refreshRate
- the refresh rate in ms_period
- the period in sMethod Detail |
---|
public static Average getInstance(int refreshRate, int period)
refreshRate
- in msperiod
- in s
public void clear()
public void cloneFrom(Average other)
public void addValue(long value)
value
- the value to be added to the Averagepublic long getAverage()
public double getDoubleAverage()
public String getDoubleAverageAsString(int precision)
public long getAverage(int average_period)
public long getPointValue()
protected final long getSum()
protected final long getSum(int slots)
protected long getEffectiveTime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |