|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmil.navy.nps.dis.RunningAverage
This Java class allows for an object that will keep N items and return the average of those items when queried.
| 21 Nov 98 | Scott D. Heller | New |
EspduTransform| Constructor Summary | |
RunningAverage(int requestedNumberOfDataPoints)
Constructor requires the number of data points to be retained to be specified. |
|
| Method Summary | |
float |
addDataPoint(float dataPoint)
Add one data point to the vector, and return the new average. |
float |
average()
Function to return the calculated average. |
protected static void |
debug(java.lang.String pDiagnostic)
Debugging output. |
boolean |
getDEBUG()
|
float |
getPrevUpdate()
Returns the last update made to the circular queue. |
void |
setDEBUG(boolean pDEBUG)
|
protected static void |
trace(java.lang.String pDiagnostic)
Debugging output. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RunningAverage(int requestedNumberOfDataPoints)
| Method Detail |
public float addDataPoint(float dataPoint)
public float average()
public float getPrevUpdate()
public boolean getDEBUG()
public void setDEBUG(boolean pDEBUG)
protected static void debug(java.lang.String pDiagnostic)
protected static void trace(java.lang.String pDiagnostic)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||