|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.statistics.Counter
public class Counter
This class implements a simple counter that can be incremented and decremented. The class is thread-safe.
| Constructor Summary | |
|---|---|
Counter(String name)
Constructor. |
|
| Method Summary | |
|---|---|
long |
decrement()
Decrement the counter by one. |
long |
getCount()
Returns the current value of the counter. |
String |
getName()
|
long |
increment()
Increment the counter by one. |
void |
reset()
Resets the statistical entity that implements this interface. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Counter(String name)
name - the counter's name| Method Detail |
|---|
public long increment()
public long decrement()
public long getCount()
public void reset()
reset in interface Resettablepublic String getName()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||