public class LongAvgStat extends StatWithValueType<Long>
definition| Constructor and Description |
|---|
LongAvgStat(StatGroup group,
StatDefinition definition)
Creates an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(long value)
Adds a new value to the average.
|
void |
add(Stat<Long> other)
Add the value of "other" to this stat.
|
void |
clear()
Resets the statistic to its initial state.
|
Stat<Long> |
computeInterval(Stat<Long> base)
Compute interval value with respect to the base value.
|
LongAvgStat |
copy()
Returns a copy of this statistic.
|
Long |
get()
Returns the value of the statistic.
|
protected String |
getFormattedValue()
Returns the value of the statistic as a formatted string.
|
Class<Long> |
getValueType()
Returns the type of the value returned by the
BaseStat.get() method. |
boolean |
isNotSet()
Returns whether the statistic is in its initial state.
|
void |
negate()
Negate the value.
|
void |
set(Long newValue)
Set the stat value.
|
getForTypecopyAndAdd, copyAndClear, getDefinition, toString, toStringVerbosepublic LongAvgStat(StatGroup group, StatDefinition definition)
group - the statistics groupdefinition - the statistics definitionpublic void add(long value)
value - the new valuepublic Class<Long> getValueType()
StatWithValueTypeBaseStat.get() method.getValueType in class StatWithValueType<Long>public void set(Long newValue)
set in class Stat<Long>UnsupportedOperationException - alwayspublic void add(Stat<Long> other)
Statpublic Stat<Long> computeInterval(Stat<Long> base)
computeInterval in class Stat<Long>IllegalArgumentException - if argument is not a LongAvgStatpublic void negate()
Statpublic LongAvgStat copy()
BaseStatpublic void clear()
BaseStatprotected String getFormattedValue()
BaseStatgetFormattedValue in class BaseStat<Long>Copyright © 2024. All rights reserved.