|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.statistics.Statistics<StatisticRefCounter>
messif.statistics.StatisticRefCounter
public final class StatisticRefCounter
Field Summary | |
---|---|
protected java.util.Map<java.lang.Object,StatisticCounter> |
values
Reference counter data |
Fields inherited from class messif.statistics.Statistics |
---|
replaceWith |
Constructor Summary | |
---|---|
protected |
StatisticRefCounter(java.lang.String name)
Creates a new instance of StatisticRefCounter |
Method Summary | |
---|---|
void |
add(java.lang.Object key)
|
void |
add(java.lang.Object key,
long value)
Adds the passed value to the current value associated with the passed key. |
void |
bindTo(StatisticCounter object,
java.lang.Object key)
Bind current statistics object to receive notifications at the same time as the specified statistics receives some. |
void |
bindTo(StatisticRefCounter object)
Bind current statistics object to receive notifications at the same time as the specified statistics receives some. |
protected StatisticRefCounter |
cast()
Returns this statistics as the type provided typed argument. |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
long |
get(java.lang.Object key)
Reference counter read operations |
int |
getKeyCount()
|
java.util.Set<java.lang.Object> |
getKeys()
|
protected StatisticCounter |
getStatisticCounter(java.lang.Object key,
boolean createIfNotExist)
Return the statistic counter associated with the provided key. |
protected StatisticCounter |
getStatisticCounter(java.lang.Object key,
boolean createIfNotExist,
long initialValue)
Return the statistic counter associated with the provided key. |
static StatisticRefCounter |
getStatistics(java.lang.String name)
Create new statistic object with specified name or get the one already existing |
boolean |
changedSinceCheckpoint()
Reports if value of refCounter has been changed since the last setCheckpoint() call. |
void |
max(java.lang.Object key,
long value)
Set the passed value to the current value associated with the passed key if it is greater than current value. |
void |
min(java.lang.Object key,
long value)
Set the passed value to the current value associated with the passed key if it is smaller than current value. |
StatisticCounter |
remove(java.lang.Object key)
Return either the StatisticCounter for given key and remove it from the mapping or return null, if the key is not in the map |
void |
reset()
Reset the current statistic (this one only). |
void |
set(java.lang.Object key,
long value)
Reference counter modification operations |
protected void |
setFrom(StatisticRefCounter sourceStat)
Set the value of this statistic to the actual value of the given sourceStat . |
void |
setCheckpoint()
Sets checkpoint. |
void |
sub(java.lang.Object key)
|
void |
sub(java.lang.Object key,
long value)
|
java.lang.String |
toString()
Text representation |
void |
unbind()
RefCounter binding overrides |
void |
unbind(java.lang.Object key)
Deregister statistic counter for key from the binding list |
protected void |
updateFrom(StatisticRefCounter sourceStat)
Statistics merging |
Methods inherited from class messif.statistics.Statistics |
---|
addBoundStat, canPerformOperation, disableGlobally, enableGlobally, getAllStatistics, getAllStatistics, getBoundStats, getBoundTo, getName, getStatistics, isBound, isEnabledGlobally, isRegisteredGlobally, printStatistics, printStatistics, printStatistics, readResolve, removeBoundStat, removeStatistic, resetStatistics, resetStatistics |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.Object,StatisticCounter> values
Constructor Detail |
---|
protected StatisticRefCounter(java.lang.String name)
Method Detail |
---|
public long get(java.lang.Object key)
public java.util.Set<java.lang.Object> getKeys()
public int getKeyCount()
public boolean containsKey(java.lang.Object key)
protected StatisticCounter getStatisticCounter(java.lang.Object key, boolean createIfNotExist, long initialValue)
key
- the reference key of the retrieved counter
protected StatisticCounter getStatisticCounter(java.lang.Object key, boolean createIfNotExist)
key
- the reference key of the retrieved counter
public void set(java.lang.Object key, long value)
public StatisticCounter remove(java.lang.Object key)
public void add(java.lang.Object key, long value)
public void add(java.lang.Object key)
public void sub(java.lang.Object key, long value)
public void sub(java.lang.Object key)
public void max(java.lang.Object key, long value)
public void min(java.lang.Object key, long value)
public void clear()
protected void updateFrom(StatisticRefCounter sourceStat)
updateFrom
in class Statistics<StatisticRefCounter>
sourceStat
- the statistic from which to update this statprotected void setFrom(StatisticRefCounter sourceStat)
Statistics
sourceStat
.
setFrom
in class Statistics<StatisticRefCounter>
sourceStat
- the statistic from which to set this statpublic void reset()
reset
in class Statistics<StatisticRefCounter>
public void bindTo(StatisticCounter object, java.lang.Object key) throws java.lang.IllegalArgumentException
object
- the parent statistics counter objectkey
- the reference key of our counter to bind it to
java.lang.IllegalArgumentException
public void unbind(java.lang.Object key)
public void unbind()
unbind
in class Statistics<StatisticRefCounter>
public void bindTo(StatisticRefCounter object) throws java.lang.IllegalArgumentException
bindTo
in class Statistics<StatisticRefCounter>
object
- the parent statistics object
java.lang.IllegalArgumentException
- if this statistic is already bound to another statpublic static StatisticRefCounter getStatistics(java.lang.String name) throws java.lang.ClassCastException
java.lang.ClassCastException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean changedSinceCheckpoint()
public void setCheckpoint()
protected StatisticRefCounter cast()
Statistics
cast
in class Statistics<StatisticRefCounter>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |