|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.util.TrailingAverage
com.threerings.tudey.util.TruncatedAverage
public class TruncatedAverage
Like TrailingAverage, but attempts to exclude outliers
(caused by periodic garbage collection, e.g.) by removing the lowest and highest values.
| Field Summary | |
|---|---|
protected int |
_omitHighest
The number of values to omit on the lower and higher ends. |
protected int |
_omitLowest
The number of values to omit on the lower and higher ends. |
protected int[] |
_sorted
An array for the sorted values. |
protected int |
_value
The current value. |
| Fields inherited from class com.threerings.media.util.TrailingAverage |
|---|
_history, _index |
| Constructor Summary | |
|---|---|
TruncatedAverage()
Creates a new truncated average that records the last ten values and omits the three highest and lowest when computing the average. |
|
TruncatedAverage(int history,
int omitLowest,
int omitHighest)
Creates a new truncated average that records the specified number of values and omits the given number of values at the higher and lower ends. |
|
| Method Summary | |
|---|---|
void |
record(int value)
|
int |
value()
|
| Methods inherited from class com.threerings.media.util.TrailingAverage |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int _omitLowest
protected int _omitHighest
protected int[] _sorted
protected int _value
| Constructor Detail |
|---|
public TruncatedAverage()
public TruncatedAverage(int history,
int omitLowest,
int omitHighest)
| Method Detail |
|---|
public void record(int value)
record in class TrailingAveragepublic int value()
value in class TrailingAverage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||