|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jwutil.sync.AtomicCounter
public class AtomicCounter
An atomic counter class. Provides atomic increment and reset functionality.
Constructor Summary | |
---|---|
AtomicCounter()
Creates new AtomicCounter, initialized to one. |
|
AtomicCounter(int initialValue)
Creates new AtomicCounter |
Method Summary | |
---|---|
int |
increment()
Increments this counter, returning the old value. |
void |
reset(int v)
Resets this counter to the given value. |
java.lang.String |
toString()
|
int |
value()
Returns the current value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AtomicCounter(int initialValue)
public AtomicCounter()
Method Detail |
---|
public int increment()
public void reset(int v)
public int value()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |