Package net.rubyeye.xmemcached
Class Counter
java.lang.Object
net.rubyeye.xmemcached.Counter
Counter,encapsulate the incr/decr methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final long
private final String
private final MemcachedClient
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
memcachedClient
-
key
-
initialValue
private final long initialValue
-
-
Constructor Details
-
Counter
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getKey
-
get
Get current value- Returns:
- Throws:
MemcachedException
InterruptedException
TimeoutException
-
set
Set counter's value to expected.- Parameters:
value
-- Throws:
MemcachedException
InterruptedException
TimeoutException
-
incrementAndGet
Increase value by one- Returns:
- Throws:
MemcachedException
InterruptedException
TimeoutException
-
decrementAndGet
Decrease value by one- Returns:
- Throws:
MemcachedException
InterruptedException
TimeoutException
-
addAndGet
Add value and get the result- Parameters:
delta
-- Returns:
- Throws:
MemcachedException
InterruptedException
TimeoutException
-