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