|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.rubyeye.xmemcached.Counter
public final class Counter
Counter,encapsulate the incr/decr methods.
| Constructor Summary | |
|---|---|
Counter(MemcachedClient memcachedClient,
java.lang.String key,
long initialValue)
|
|
| Method Summary | |
|---|---|
long |
addAndGet(long delta)
Add value and get the result |
long |
decrementAndGet()
Decrease value by one |
boolean |
equals(java.lang.Object obj)
|
long |
get()
Get current value |
java.lang.String |
getKey()
|
int |
hashCode()
|
long |
incrementAndGet()
Increase value by one |
void |
set(long value)
Set counter's value to expected. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Counter(MemcachedClient memcachedClient,
java.lang.String key,
long initialValue)
| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final java.lang.String getKey()
public long get()
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public void set(long value)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
value -
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public long incrementAndGet()
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public long decrementAndGet()
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public long addAndGet(long delta)
throws MemcachedException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
delta -
MemcachedException
java.lang.InterruptedException
java.util.concurrent.TimeoutException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||