|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.NullSimon
org.javasimon.NullCounter
final class NullCounter
Null Counter implements Simon returned by the disabled Manager.getCounter(String).
It extends NullSimon to satisfy Counter interface.
| Field Summary | |
|---|---|
(package private) static NullCounter |
INSTANCE
Internal singleton value of the null Counter. |
| Constructor Summary | |
|---|---|
private |
NullCounter()
|
| Method Summary | |
|---|---|
Counter |
decrease()
Decrements the counter by one. |
Counter |
decrease(long dec)
Increments the counter by the specified value. |
long |
getCounter()
Returns the current value of the counter. |
long |
getDecrementSum()
Returns the sum of all decremented values (as a positive number). |
long |
getIncrementSum()
Returns the sum of all incremented values. |
long |
getMax()
Returns maximal value of counter. |
long |
getMaxTimestamp()
Returns ms timestamp when the max value was reached. |
long |
getMin()
Returns minimal value of counter. |
long |
getMinTimestamp()
Returns ms timestamp when the min value was reached. |
Counter |
increase()
Increments the counter by one. |
Counter |
increase(long inc)
Increments the counter by the specified value. |
NullCounter |
reset()
Resets the Simon values related to the measuring, timestamps and so on - usage timestamps, state, attributes are not affected. |
CounterSample |
sample()
Samples Simon values and returns them in a Java Bean derived from Sample interface. |
CounterSample |
sampleAndReset()
Samples Simon values and returns them in a Java Bean derived from Sample interface and resets the Simon. |
Counter |
set(long val)
Sets the value of the counter to specified value. |
| Methods inherited from class org.javasimon.NullSimon |
|---|
getAttribute, getAttribute, getAttributeNames, getCopyAsSortedMap, getFirstUsage, getChildren, getLastReset, getLastUsage, getName, getNote, getParent, getState, isEnabled, removeAttribute, setAttribute, setNote, setState, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.javasimon.Simon |
|---|
getFirstUsage, getChildren, getLastReset, getLastUsage, getName, getNote, getParent, getState, isEnabled, setNote, setState |
| Methods inherited from interface org.javasimon.HasAttributes |
|---|
getAttribute, getAttribute, getAttributeNames, getCopyAsSortedMap, removeAttribute, setAttribute |
| Field Detail |
|---|
static final NullCounter INSTANCE
Counter interface - only its behavior manifests to the client.
| Constructor Detail |
|---|
private NullCounter()
| Method Detail |
|---|
public NullCounter reset()
SimonSimon.getLastReset(). Reset is perfomed even for disabled Simons.
reset in interface Counterreset in interface Simonreset in class NullSimonpublic Counter set(long val)
Counter
set in interface Counterval - new counter value
public Counter increase()
Counter
increase in interface Counterpublic Counter decrease()
Counter
decrease in interface Counterpublic Counter increase(long inc)
Counter
increase in interface Counterinc - added value
public Counter decrease(long dec)
Counter
decrease in interface Counterdec - subtracted value
public long getCounter()
Counter
getCounter in interface Counterpublic long getMin()
Counter
getMin in interface Counterpublic long getMax()
Counter
getMax in interface Counterpublic long getMaxTimestamp()
Counter
getMaxTimestamp in interface Counterpublic long getMinTimestamp()
Counter
getMinTimestamp in interface Counterpublic long getIncrementSum()
Counter
getIncrementSum in interface Counterpublic long getDecrementSum()
Counter
getDecrementSum in interface Counterpublic CounterSample sample()
Simon
sample in interface Countersample in interface Simonsample in class NullSimonpublic CounterSample sampleAndReset()
Simon
sampleAndReset in interface CountersampleAndReset in interface SimonsampleAndReset in class NullSimon
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||