|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.Averager
Class Averager implements a "windowed" average, where the average of the last 'n' values entered is calculated.
Constructor Summary | |
Averager(int windowSize)
Creates a "windowed" averaging object. |
Method Summary | |
void |
clear()
Clears the averaging "window" back to its initial state. |
long |
enter(long val)
Enters the new value into the averaging "window". |
long |
getAverage()
Returns the current average of values in the "window". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Averager(int windowSize)
windowSize
- the number of values to track and use when
computing the average. If the value is not greater than zero
then a runtime exception is thrown.Method Detail |
public void clear()
public long enter(long val)
val
- the value to be entered.
public long getAverage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |