Tanzu GemFire Distributed Types Java API Reference
Package dev.gemfire.dtype
Interface DAtomicReference<V>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VaccumulateAndGet(V x, java.util.function.BinaryOperator<V> accumulatorFunction)Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value.booleancompareAndSet(V expect, V update)Atomically sets the value to the given updated value if the current value == the expected value.Vget()Gets the current value.VgetAndAccumulate(V x, java.util.function.BinaryOperator<V> accumulatorFunction)Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value.VgetAndSet(V newValue)Atomically sets to the given value and returns the old value.VgetAndUpdate(java.util.function.UnaryOperator<V> updateFunction)Atomically updates the current value with the results of applying the given function, returning the previous value.voidset(V newValue)Sets to the given value.VupdateAndGet(java.util.function.UnaryOperator<V> updateFunction)Atomically updates the current value with the results of applying the given function, returning the updated value.
-
-
-
Method Detail
-
accumulateAndGet
V accumulateAndGet(V x, java.util.function.BinaryOperator<V> accumulatorFunction)
Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value.- Parameters:
x- the update valueaccumulatorFunction- a side-effect-free function of two arguments- Returns:
- the updated value
-
compareAndSet
boolean compareAndSet(V expect, V 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:
- true if successful
-
get
V get()
Gets the current value.- Returns:
- the current value
-
getAndAccumulate
V getAndAccumulate(V x, java.util.function.BinaryOperator<V> accumulatorFunction)
Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value.- Parameters:
x- the update valueaccumulatorFunction- a side-effect-free function of two arguments- Returns:
- the previous value
-
getAndUpdate
V getAndUpdate(java.util.function.UnaryOperator<V> updateFunction)
Atomically updates the current value with the results of applying the given function, returning the previous value.- Parameters:
updateFunction- a side-effect-free function- Returns:
- the previous value
-
getAndSet
V getAndSet(V newValue)
Atomically sets to the given value and returns the old value.- Parameters:
newValue- the value to set- Returns:
- the previous value
-
set
void set(V newValue)
Sets to the given value.- Parameters:
newValue- the value to set
-
-