public final class Counter extends Object
| 构造器和说明 |
|---|
Counter(MemcachedClient memcachedClient,
String key,
long initialValue) |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
addAndGet(long delta)
Add value and get the result
|
long |
decrementAndGet()
Decrease value by one
|
boolean |
equals(Object obj) |
long |
get()
Get current value
|
String |
getKey() |
int |
hashCode() |
long |
incrementAndGet()
Increase value by one
|
void |
set(long value)
Set counter's value to expected.
|
public Counter(MemcachedClient memcachedClient, String key, long initialValue)
public final String getKey()
public long get()
throws MemcachedException,
InterruptedException,
TimeoutException
public void set(long value)
throws MemcachedException,
InterruptedException,
TimeoutException
value - MemcachedExceptionInterruptedExceptionTimeoutExceptionpublic long incrementAndGet()
throws MemcachedException,
InterruptedException,
TimeoutException
public long decrementAndGet()
throws MemcachedException,
InterruptedException,
TimeoutException
public long addAndGet(long delta)
throws MemcachedException,
InterruptedException,
TimeoutException
delta - MemcachedExceptionInterruptedExceptionTimeoutExceptionCopyright © 2013. All Rights Reserved.