T - the value type of the individual statisticsC - the class of the individual statisticspublic abstract class MapStat<T,C extends MapStatComponent<T,C>> extends Stat<String>
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,C> |
statMap
Maps keys to individual statistics.
|
definition| Modifier | Constructor and Description |
|---|---|
protected |
MapStat(MapStat<T,C> other)
Creates an instance of this class as a copy of another instance.
|
protected |
MapStat(StatGroup group,
StatDefinition definition)
Creates an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Stat<String> other)
Add the value of "other" to this stat.
|
void |
clear()
Resets the statistic to its initial state.
|
Stat<String> |
copyAndClear()
This implementation adds synchronization.
|
String |
get()
Returns the map as a string in the format returned by
getFormattedValue(), but with values presented without using commas. |
protected String |
getFormattedValue()
This implementation returns the keys and values of the individual
statistics in the format:
KEY=VALUE[;KEY=VALUE]. |
SortedMap<String,T> |
getMap()
Returns a map from keys to values of individual statistics, ignoring
individual statistics that are not set.
|
boolean |
isNotSet()
Returns whether the statistic is in its initial state.
|
void |
removeStat(String key)
Removes the individual statistic associated with the specified key.
|
void |
set(String value)
Set the stat value.
|
computeInterval, copy, copyAndAdd, getDefinition, negate, toString, toStringVerboseprotected MapStat(StatGroup group, StatDefinition definition)
group - the owning groupdefinition - the associated definitionpublic void removeStat(String key)
key - the keypublic SortedMap<String,T> getMap()
public String get()
getFormattedValue(), but with values presented without using commas.public void clear()
BaseStatprotected String getFormattedValue()
KEY=VALUE[;KEY=VALUE].getFormattedValue in class BaseStat<String>public boolean isNotSet()
BaseStatpublic void set(String value)
Statset in class Stat<String>UnsupportedOperationException - alwayspublic void add(Stat<String> other)
Statadd in class Stat<String>UnsupportedOperationException - alwayspublic Stat<String> copyAndClear()
copyAndClear in class Stat<String>Copyright © 2024. All rights reserved.