public interface AsyncAtomicCounterMap<K>
| 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<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<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<Long> incrementAndGet(K key)
key - key with which the specified value is to be associatedCompletableFuture<Long> decrementAndGet(K key)
key - key with which the specified value is to be associatedCompletableFuture<Long> getAndIncrement(K key)
key - key with which the specified value is to be associatedCompletableFuture<Long> getAndDecrement(K key)
key - key with which the specified value is to be associatedCompletableFuture<Long> addAndGet(K key, long delta)
key - key with which the specified value is to be associateddelta - the value to addCompletableFuture<Long> getAndAdd(K key, long delta)
key - key with which the specified value is to be associateddelta - the value to addCompletableFuture<Long> get(K key)
key - key with which the specified value is to be associatedCompletableFuture<Long> put(K key, long newValue)
key - key with which the specified value is to be associatednewValue - the value to putCompletableFuture<Long> putIfAbsent(K key, long newValue)
key - key with which the specified value is to be associatednewValue - the value to putCompletableFuture<Boolean> replace(K key, long expectedOldValue, long newValue)
key - key with which the specified value is to be associatedexpectedOldValue - the expected valuenewValue - the value to replaceCompletableFuture<Long> remove(K key)
key - key with which the specified value is to be associatedCompletableFuture<Boolean> remove(K key, long value)
key - key with which the specified value is to be associatedvalue - the value to remove