Package arc.math
Class FloatCounter
java.lang.Object
arc.math.FloatCounter
Track properties of a stream of float values. The properties (total value, minimum, etc) are updated as values are
put(float) into the stream.-
Field Summary
FieldsModifier and TypeFieldDescriptionfloatThe average value (total / count)intThe amount of values addedfloatThe latest raw valuefloatThe largest valuefinal WindowedMeanProvides access to the WindowedMean if any (can be null)floatThe smallest valuefloatThe sum of all valuesfloatThe current windowed mean value -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
mean
Provides access to the WindowedMean if any (can be null) -
count
public int countThe amount of values added -
total
public float totalThe sum of all values -
min
public float minThe smallest value -
max
public float maxThe largest value -
average
public float averageThe average value (total / count) -
latest
public float latestThe latest raw value -
value
public float valueThe current windowed mean value
-
-
Constructor Details
-
FloatCounter
public FloatCounter(int windowSize) Construct a new FloatCounter- Parameters:
windowSize- The size of the mean window or 1 or below to not use a windowed mean.
-
-
Method Details
-
put
public void put(float value) Add a value and update all fields.- Parameters:
value- The value to add
-
reset
public void reset()Reset all values to their default value.
-