Tanzu GemFire Distributed Types Java API Reference
Package dev.gemfire.dtype
Interface DAtomicLong
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longaddAndGet(long delta)Atomically adds the given value to the current value.booleancompareAndSet(long expect, long update)Atomically sets the value to the given updated value if the current value==the expected value.longget()Gets the current value.longgetAndAdd(long delta)Atomically adds the given value to the current value.longgetAndSet(long newValue)Atomically sets to the given value and returns the old value.voidset(long value)Set the given value atomically.
-
-
-
Method Detail
-
get
long get()
Gets the current value.- Returns:
- the current value
-
set
void set(long value)
Set the given value atomically.- Parameters:
value- the value to set
-
getAndAdd
long getAndAdd(long delta)
Atomically adds the given value to the current value.- Parameters:
delta- the value to add- Returns:
- the previous value
-
getAndSet
long getAndSet(long newValue)
Atomically sets to the given value and returns the old value.- Parameters:
newValue- the new value- Returns:
- the previous value
-
addAndGet
long addAndGet(long delta)
Atomically adds the given value to the current value.- Parameters:
delta- the value to add- Returns:
- the updated value
-
compareAndSet
boolean compareAndSet(long expect, long update)Atomically sets the value to the given updated value if the current value==the expected value.- Parameters:
expect- the expected valueupdate- the new value- Returns:
trueif successful. False return indicates that the actual value was not equal to the expected value.
-
-