public final class Counter extends Object
Constructor and Description |
---|
Counter(MemcachedClient memcachedClient,
String key,
long initialValue) |
Modifier and Type | Method and Description |
---|---|
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
MemcachedException
InterruptedException
TimeoutException
public void set(long value) throws MemcachedException, InterruptedException, TimeoutException
value
- MemcachedException
InterruptedException
TimeoutException
public long incrementAndGet() throws MemcachedException, InterruptedException, TimeoutException
MemcachedException
InterruptedException
TimeoutException
public long decrementAndGet() throws MemcachedException, InterruptedException, TimeoutException
MemcachedException
InterruptedException
TimeoutException
public long addAndGet(long delta) throws MemcachedException, InterruptedException, TimeoutException
delta
- MemcachedException
InterruptedException
TimeoutException
Copyright © 2021. All rights reserved.