public class FixedRunningAverage extends Object implements RunningAverage, Serializable
A simple class that represents a fixed value of an average and count. This is useful
when an API needs to return RunningAverage but is not in a position to accept
updates to it.
| Constructor and Description |
|---|
FixedRunningAverage(double average,
int count) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDatum(double datum) |
void |
changeDatum(double delta) |
double |
getAverage() |
int |
getCount() |
RunningAverage |
inverse() |
void |
removeDatum(double datum) |
String |
toString() |
public void addDatum(double datum)
addDatum in interface RunningAveragedatum - new item to add to the running averageUnsupportedOperationExceptionpublic void removeDatum(double datum)
removeDatum in interface RunningAveragedatum - item to remove to the running averageUnsupportedOperationExceptionpublic void changeDatum(double delta)
changeDatum in interface RunningAveragedelta - amount by which to change a datum in the running averageUnsupportedOperationExceptionpublic int getCount()
getCount in interface RunningAveragepublic double getAverage()
getAverage in interface RunningAveragepublic RunningAverage inverse()
inverse in interface RunningAverageCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.