Package com.biglybt.core.util
Class PausableAverage
- java.lang.Object
-
- com.biglybt.core.util.Average
-
- com.biglybt.core.util.PausableAverage
-
public class PausableAverage extends Average
-
-
Field Summary
Fields Modifier and Type Field Description private long
offset
private long
pause_time
-
Constructor Summary
Constructors Modifier Constructor Description private
PausableAverage(int _refreshRate, int _period)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.long
getAverage()
This method can be called to get the current average value.protected long
getEffectiveTime()
static PausableAverage
getPausableInstance(int refreshRate, int period)
void
pause()
void
resume()
-
Methods inherited from class com.biglybt.core.util.Average
clear, cloneFrom, getAverage, getDoubleAverage, getDoubleAverageAsString, getInstance, getPointValue, getSum, getSum
-
-
-
-
Method Detail
-
getPausableInstance
public static PausableAverage getPausableInstance(int refreshRate, int period)
-
addValue
public void addValue(long value)
Description copied from class:Average
Public method to add a value to the average, the time it is added is the time this method is called.
-
getAverage
public long getAverage()
Description copied from class:Average
This method can be called to get the current average value.- Overrides:
getAverage
in classAverage
- Returns:
- the current Average computed.
-
getEffectiveTime
protected long getEffectiveTime()
- Overrides:
getEffectiveTime
in classAverage
-
pause
public void pause()
-
resume
public void resume()
-
-