|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.utils.Counter
Provides basic counter statistics.
The Counter class counts the current, peak and total number of simultaneous events.
This class is synchronized and the numbers returned by the getter methods are always consistent with the actual counter's internal state.
Constructor Summary | |
Counter()
|
Method Summary | |
void |
dec()
Decrements the counter. |
int |
getCurrent()
Returns the current number of events. |
int |
getPeak()
Returns the peak number of events. |
long |
getTotal()
Returns the total number of events. |
void |
inc()
Increments the counter. |
void |
reset()
Resets the counter. |
void |
resetCurrent()
Resets the counter. |
java.lang.String |
toString()
Returns the current/peak/total number of the events. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Counter()
Method Detail |
public void inc()
Should be called when the particular counted event starts.
public void dec()
Should be called when the particular counted event ends.
public void resetCurrent()
Sets the current number of events to zero.
public void reset()
Sets the current/peak/total number of events to zero.
public int getCurrent()
public int getPeak()
public long getTotal()
public java.lang.String toString()
If the total number ends with asterisk, it means that it reached the maximum possible value and the counter started from zero again.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |