public interface Counter
| Modifier and Type | Method and Description |
|---|---|
void |
addAndGet(long value,
Handler<AsyncResult<Long>> resultHandler)
Add the value to the counter atomically and return the new count
|
void |
compareAndSet(long expected,
long value,
Handler<AsyncResult<Boolean>> resultHandler)
Set the counter to the specified value only if the current value is the expectec value.
|
void |
decrementAndGet(Handler<AsyncResult<Long>> resultHandler)
Decrement the counter atomically and return the new count
|
void |
get(Handler<AsyncResult<Long>> resultHandler)
Get the current value of the counter
|
void |
getAndAdd(long value,
Handler<AsyncResult<Long>> resultHandler)
Add the value to the counter atomically and return the value before the add
|
void |
getAndIncrement(Handler<AsyncResult<Long>> resultHandler)
Increment the counter atomically and return the value before the increment.
|
void |
incrementAndGet(Handler<AsyncResult<Long>> resultHandler)
Increment the counter atomically and return the new count
|
void get(Handler<AsyncResult<Long>> resultHandler)
resultHandler - handler which will be passed the valuevoid incrementAndGet(Handler<AsyncResult<Long>> resultHandler)
resultHandler - handler which will be passed the valuevoid getAndIncrement(Handler<AsyncResult<Long>> resultHandler)
resultHandler - handler which will be passed the valuevoid decrementAndGet(Handler<AsyncResult<Long>> resultHandler)
resultHandler - handler which will be passed the valuevoid addAndGet(long value,
Handler<AsyncResult<Long>> resultHandler)
value - the value to addresultHandler - handler which will be passed the valuevoid getAndAdd(long value,
Handler<AsyncResult<Long>> resultHandler)
value - the value to addresultHandler - handler which will be passed the valuevoid compareAndSet(long expected,
long value,
Handler<AsyncResult<Boolean>> resultHandler)
expected - the expected valuevalue - the new valueresultHandler - the handler will be passed true on successCopyright © 2015. All rights reserved.