|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Counter
Method Summary | |
---|---|
long |
addAndGet(long delta)
Atomically adds the given value to the current value. |
boolean |
compareAndSet(long expect,
long update)
Atomically updates the counter using a CAS operation |
long |
decrementAndGet()
Atomically decrements the counter and returns the new value |
long |
get()
Gets the current value of the counter |
java.lang.String |
getName()
|
long |
incrementAndGet()
Atomically increments the counter and returns the new value |
void |
set(long new_value)
Sets the counter to a new value |
Method Detail |
---|
java.lang.String getName()
long get()
void set(long new_value)
new_value
- The new valueboolean compareAndSet(long expect, long update)
expect
- The expected value of the counterupdate
- The new value of the counter
long incrementAndGet()
long decrementAndGet()
long addAndGet(long delta)
delta
- the value to add
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |