|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DistributedAtomicNumber<T>
| Method Summary | |
|---|---|
AtomicValue<T> |
add(T delta)
Add delta to the current value and return the new value information. |
AtomicValue<T> |
compareAndSet(T expectedValue,
T newValue)
Atomically sets the value to the given updated value if the current value == the expected value. |
AtomicValue<T> |
decrement()
Subtract 1 from the current value and return the new value information. |
void |
forceSet(T newValue)
Forcibly sets the value of the counter without any guarantees of atomicity. |
AtomicValue<T> |
get()
Returns the current value of the counter. |
AtomicValue<T> |
increment()
Add 1 to the current value and return the new value information. |
AtomicValue<T> |
subtract(T delta)
Subtract delta from the current value and return the new value information. |
AtomicValue<T> |
trySet(T newValue)
Attempt to atomically set the value to the given value. |
| Method Detail |
|---|
AtomicValue<T> get()
throws java.lang.Exception
0 is returned.
java.lang.Exception - ZooKeeper errors
AtomicValue<T> compareAndSet(T expectedValue,
T newValue)
throws java.lang.Exception
== the expected value.
Remember to always check AtomicValue.succeeded().
expectedValue - the expected valuenewValue - the new value for the counter
java.lang.Exception - ZooKeeper errors
AtomicValue<T> trySet(T newValue)
throws java.lang.Exception
AtomicValue.succeeded().
newValue - the value to set
java.lang.Exception - ZooKeeper errors
void forceSet(T newValue)
throws java.lang.Exception
newValue - the new value
java.lang.Exception - ZooKeeper errors
AtomicValue<T> increment()
throws java.lang.Exception
AtomicValue.succeeded().
java.lang.Exception - ZooKeeper errors
AtomicValue<T> decrement()
throws java.lang.Exception
AtomicValue.succeeded().
java.lang.Exception - ZooKeeper errors
AtomicValue<T> add(T delta)
throws java.lang.Exception
AtomicValue.succeeded().
delta - amount to add
java.lang.Exception - ZooKeeper errors
AtomicValue<T> subtract(T delta)
throws java.lang.Exception
AtomicValue.succeeded().
delta - amount to subtract
java.lang.Exception - ZooKeeper errors
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||