public class ExecutingAsyncAtomicCounterMap<K> extends ExecutingDistributedPrimitive implements AsyncAtomicCounterMap<K>
AsyncAtomicCounterMap that executes asynchronous callbacks on a user provided
Executor.DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Constructor and Description |
|---|
ExecutingAsyncAtomicCounterMap(AsyncAtomicCounterMap<K> delegateMap,
Executor orderedExecutor,
Executor threadPoolExecutor) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Long> |
addAndGet(K key,
long delta)
Adds delta to the value currently associated with key, and returns the new value.
|
CompletableFuture<Void> |
clear()
Removes all entries from the map.
|
CompletableFuture<Long> |
decrementAndGet(K key)
Decrements by one the value currently associated with key, and returns the new value.
|
CompletableFuture<Long> |
get(K key)
Returns the value associated with key, or zero if there is no value associated with key.
|
CompletableFuture<Long> |
getAndAdd(K key,
long delta)
Adds delta to the value currently associated with key, and returns the old value.
|
CompletableFuture<Long> |
getAndDecrement(K key)
Decrements by one the value currently associated with key, and returns the old value.
|
CompletableFuture<Long> |
getAndIncrement(K key)
Increments by one the value currently associated with key, and returns the old value.
|
CompletableFuture<Long> |
incrementAndGet(K key)
Increments by one the value currently associated with key, and returns the new value.
|
CompletableFuture<Boolean> |
isEmpty()
Returns a boolean indicating whether the map is empty.
|
CompletableFuture<Long> |
put(K key,
long newValue)
Associates ewValue with key in this map, and returns the value previously
associated with key, or zero if there was no such value.
|
CompletableFuture<Long> |
putIfAbsent(K key,
long newValue)
If key is not already associated with a value or if key is associated with
zero, associate it with newValue.
|
CompletableFuture<Long> |
remove(K key)
Removes and returns the value associated with key.
|
CompletableFuture<Boolean> |
remove(K key,
long value)
If (key, value) is currently in the map, this method removes it and returns
true; otherwise, this method returns false.
|
CompletableFuture<Boolean> |
replace(K key,
long expectedOldValue,
long newValue)
If (key, expectedOldValue) is currently in the map, this method replaces
expectedOldValue with newValue and returns true; otherwise, this method return false.
|
CompletableFuture<Integer> |
size()
Returns the number of entries in the map.
|
addStatusChangeListener, asyncFuture, destroy, removeStatusChangeListenerapplicationId, equals, hashCode, name, primitiveType, statusChangeListeners, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitasAtomicCounterMap, asAtomicCounterMap, primitiveTypeaddStatusChangeListener, applicationId, destroy, name, removeStatusChangeListener, statusChangeListenerspublic ExecutingAsyncAtomicCounterMap(AsyncAtomicCounterMap<K> delegateMap, Executor orderedExecutor, Executor threadPoolExecutor)
public CompletableFuture<Long> incrementAndGet(K key)
AsyncAtomicCounterMapincrementAndGet in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> decrementAndGet(K key)
AsyncAtomicCounterMapdecrementAndGet in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> getAndIncrement(K key)
AsyncAtomicCounterMapgetAndIncrement in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> getAndDecrement(K key)
AsyncAtomicCounterMapgetAndDecrement in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> addAndGet(K key, long delta)
AsyncAtomicCounterMapaddAndGet in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associateddelta - the value to addpublic CompletableFuture<Long> getAndAdd(K key, long delta)
AsyncAtomicCounterMapgetAndAdd in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associateddelta - the value to addpublic CompletableFuture<Long> get(K key)
AsyncAtomicCounterMapget in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> put(K key, long newValue)
AsyncAtomicCounterMapput in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatednewValue - the value to putpublic CompletableFuture<Long> putIfAbsent(K key, long newValue)
AsyncAtomicCounterMapputIfAbsent in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatednewValue - the value to putpublic CompletableFuture<Boolean> replace(K key, long expectedOldValue, long newValue)
AsyncAtomicCounterMapreplace in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedexpectedOldValue - the expected valuenewValue - the value to replacepublic CompletableFuture<Long> remove(K key)
AsyncAtomicCounterMapremove in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedpublic CompletableFuture<Boolean> remove(K key, long value)
AsyncAtomicCounterMapremove in interface AsyncAtomicCounterMap<K>key - key with which the specified value is to be associatedvalue - the value to removepublic CompletableFuture<Integer> size()
AsyncAtomicCounterMapsize in interface AsyncAtomicCounterMap<K>public CompletableFuture<Boolean> isEmpty()
AsyncAtomicCounterMapisEmpty in interface AsyncAtomicCounterMap<K>public CompletableFuture<Void> clear()
AsyncAtomicCounterMapclear in interface AsyncAtomicCounterMap<K>