public final class StatisticCounter extends Statistics<StatisticCounter>
Modifier and Type | Field and Description |
---|---|
protected long |
value |
replaceWith
Modifier | Constructor and Description |
---|---|
protected |
StatisticCounter(java.lang.String name)
Creates a new instance of StatisticCounter
|
protected |
StatisticCounter(java.lang.String name,
long value)
Creates a new instance of StatisticCounter
|
Modifier and Type | Method and Description |
---|---|
void |
add() |
void |
add(long value) |
protected StatisticCounter |
cast()
Returns this statistics as the type provided typed argument.
|
long |
get() |
static StatisticCounter |
getStatistics(java.lang.String name)
Create new statistic counter with specified name or get the one already existing
|
java.lang.Long |
getValue()
Returns the value of this statistic.
|
boolean |
changedSinceCheckpoint()
Reports if value of counter has been changed since the last setCheckpoint() call.
|
void |
max(long value) |
void |
min(long value) |
void |
reset()
Reset the current statistic (this one only).
|
void |
set(long value) |
protected void |
setFrom(StatisticCounter sourceStat)
Set the value of this statistic to the actual value of the given
sourceStat . |
void |
setCheckpoint()
Sets checkpoint.
|
void |
sub() |
void |
sub(long value) |
java.lang.String |
toString() |
protected void |
updateFrom(StatisticCounter sourceStat)
Updates the value of this statistic from the given
sourceStat . |
addBoundStat, bindTo, canPerformOperation, disableGlobally, enableGlobally, getAllStatistics, getAllStatistics, getBoundStats, getBoundTo, getName, getStatistics, isBound, isEnabledGlobally, isRegisteredGlobally, printStatistics, printStatistics, printStatistics, readResolve, removeBoundStat, removeStatistic, resetStatistics, resetStatistics, unbind
protected StatisticCounter(java.lang.String name)
protected StatisticCounter(java.lang.String name, long value)
protected StatisticCounter cast()
Statistics
cast
in class Statistics<StatisticCounter>
public void set(long value)
public void add(long value)
public void add()
public void sub(long value)
public void sub()
public long get()
public java.lang.Long getValue()
Statistics
getValue
in class Statistics<StatisticCounter>
public void max(long value)
public void min(long value)
protected void updateFrom(StatisticCounter sourceStat)
Statistics
sourceStat
.
Specifically, this method merges the value of the sourceStat
with this statistic.
The actual implementation depends on the type of the statistic.
updateFrom
in class Statistics<StatisticCounter>
sourceStat
- the statistic from which to update this statprotected void setFrom(StatisticCounter sourceStat)
Statistics
sourceStat
.setFrom
in class Statistics<StatisticCounter>
sourceStat
- the statistic from which to set this statpublic void reset()
reset
in class Statistics<StatisticCounter>
public static StatisticCounter getStatistics(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean changedSinceCheckpoint()
public void setCheckpoint()