public class TranscodingAsyncAtomicCounterMap<K1,K2> extends Object implements AsyncAtomicCounterMap<K1>
AsyncAtomicCounterMap that transcodes keys.DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Constructor and Description |
|---|
TranscodingAsyncAtomicCounterMap(AsyncAtomicCounterMap<K2> backingMap,
Function<K1,K2> keyEncoder,
Function<K2,K1> keyDecoder) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Long> |
addAndGet(K1 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(K1 key)
Decrements by one the value currently associated with key, and returns the new value.
|
CompletableFuture<Long> |
get(K1 key)
Returns the value associated with key, or zero if there is no value associated with key.
|
CompletableFuture<Long> |
getAndAdd(K1 key,
long delta)
Adds delta to the value currently associated with key, and returns the old value.
|
CompletableFuture<Long> |
getAndDecrement(K1 key)
Decrements by one the value currently associated with key, and returns the old value.
|
CompletableFuture<Long> |
getAndIncrement(K1 key)
Increments by one the value currently associated with key, and returns the old value.
|
CompletableFuture<Long> |
incrementAndGet(K1 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.
|
String |
name()
Returns the name of this primitive.
|
CompletableFuture<Long> |
put(K1 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(K1 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(K1 key)
Removes and returns the value associated with key.
|
CompletableFuture<Boolean> |
remove(K1 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(K1 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasAtomicCounterMap, asAtomicCounterMap, primitiveTypeaddStatusChangeListener, applicationId, destroy, removeStatusChangeListener, statusChangeListenerspublic String name()
DistributedPrimitivename in interface DistributedPrimitivepublic CompletableFuture<Long> incrementAndGet(K1 key)
AsyncAtomicCounterMapincrementAndGet in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> decrementAndGet(K1 key)
AsyncAtomicCounterMapdecrementAndGet in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> getAndIncrement(K1 key)
AsyncAtomicCounterMapgetAndIncrement in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> getAndDecrement(K1 key)
AsyncAtomicCounterMapgetAndDecrement in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> addAndGet(K1 key, long delta)
AsyncAtomicCounterMapaddAndGet in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associateddelta - the value to addpublic CompletableFuture<Long> getAndAdd(K1 key, long delta)
AsyncAtomicCounterMapgetAndAdd in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associateddelta - the value to addpublic CompletableFuture<Long> get(K1 key)
AsyncAtomicCounterMapget in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedpublic CompletableFuture<Long> put(K1 key, long newValue)
AsyncAtomicCounterMapput in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatednewValue - the value to putpublic CompletableFuture<Long> putIfAbsent(K1 key, long newValue)
AsyncAtomicCounterMapputIfAbsent in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatednewValue - the value to putpublic CompletableFuture<Boolean> replace(K1 key, long expectedOldValue, long newValue)
AsyncAtomicCounterMapreplace in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedexpectedOldValue - the expected valuenewValue - the value to replacepublic CompletableFuture<Long> remove(K1 key)
AsyncAtomicCounterMapremove in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedpublic CompletableFuture<Boolean> remove(K1 key, long value)
AsyncAtomicCounterMapremove in interface AsyncAtomicCounterMap<K1>key - key with which the specified value is to be associatedvalue - the value to removepublic CompletableFuture<Integer> size()
AsyncAtomicCounterMapsize in interface AsyncAtomicCounterMap<K1>public CompletableFuture<Boolean> isEmpty()
AsyncAtomicCounterMapisEmpty in interface AsyncAtomicCounterMap<K1>public CompletableFuture<Void> clear()
AsyncAtomicCounterMapclear in interface AsyncAtomicCounterMap<K1>