K
- keyV
- valuepublic interface RMultimap<K,V> extends RExpirable, RMultimapAsync<K,V>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all key-value pairs from the multimap, leaving it empty.
|
boolean |
containsEntry(Object key,
Object value)
Returns
true if this multimap contains at least one key-value pair
with the key key and the value value . |
boolean |
containsKey(Object key)
Returns
true if this multimap contains at least one key-value pair
with the key key . |
boolean |
containsValue(Object value)
Returns
true if this multimap contains at least one key-value pair
with the value value . |
Collection<Map.Entry<K,V>> |
entries()
Returns a view collection of all key-value pairs contained in this
multimap, as
Map.Entry instances. |
long |
fastRemove(K... keys)
Removes
keys from map by one operation
Works faster than RMultimap.remove but not returning
the value associated with key |
Collection<V> |
get(K key)
Returns a view collection of the values associated with
key in this
multimap, if any. |
Collection<V> |
getAll(K key)
Returns all elements at once.
|
RCountDownLatch |
getCountDownLatch(K key)
Returns
RCountDownLatch instance associated with key |
RLock |
getFairLock(K key)
Returns
RLock instance associated with key |
RLock |
getLock(K key)
Returns
RLock instance associated with key |
RPermitExpirableSemaphore |
getPermitExpirableSemaphore(K key)
Returns
RPermitExpirableSemaphore instance associated with key |
RReadWriteLock |
getReadWriteLock(K key)
Returns
RReadWriteLock instance associated with key |
RSemaphore |
getSemaphore(K key)
Returns
RSemaphore instance associated with key |
boolean |
isEmpty()
Check is map empty
|
Set<K> |
keySet()
Returns a view collection of all distinct keys contained in this
multimap.
|
int |
keySize()
Returns the count of distinct keys in this multimap.
|
boolean |
put(K key,
V value)
Stores a key-value pair in this multimap.
|
boolean |
putAll(K key,
Iterable<? extends V> values)
Stores a key-value pair in this multimap for each of
values , all
using the same key, key . |
Set<K> |
readAllKeySet()
Read all keys at once
|
boolean |
remove(Object key,
Object value)
Removes a single key-value pair with the key
key and the value
value from this multimap, if such exists. |
Collection<V> |
removeAll(Object key)
Removes all values associated with the key
key . |
Collection<V> |
replaceValues(K key,
Iterable<? extends V> values)
Stores a collection of values with the same key, replacing any existing
values for that key.
|
int |
size()
Returns the number of key-value pairs in this multimap.
|
Collection<V> |
values()
Returns a view collection containing the value from each key-value
pair contained in this multimap, without collapsing duplicates (so
values().size() == size() ). |
clearExpire, expire, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
containsEntryAsync, containsKeyAsync, containsValueAsync, fastRemoveAsync, getAllAsync, keySizeAsync, putAllAsync, putAsync, readAllKeySetAsync, removeAllAsync, removeAsync, replaceValuesAsync, sizeAsync
clearExpireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
RCountDownLatch getCountDownLatch(K key)
RCountDownLatch
instance associated with keykey
- - map keyRPermitExpirableSemaphore getPermitExpirableSemaphore(K key)
RPermitExpirableSemaphore
instance associated with keykey
- - map keyRSemaphore getSemaphore(K key)
RSemaphore
instance associated with keykey
- - map keyRLock getFairLock(K key)
RLock
instance associated with keykey
- - map keyRReadWriteLock getReadWriteLock(K key)
RReadWriteLock
instance associated with keykey
- - map keyRLock getLock(K key)
RLock
instance associated with keykey
- - map keyint size()
boolean isEmpty()
true
if emptyboolean containsKey(Object key)
true
if this multimap contains at least one key-value pair
with the key key
.key
- - map keytrue
if contains a keyboolean containsValue(Object value)
true
if this multimap contains at least one key-value pair
with the value value
.value
- - map valuetrue
if contains a valueboolean containsEntry(Object key, Object value)
true
if this multimap contains at least one key-value pair
with the key key
and the value value
.key
- - map keyvalue
- - map valuetrue
if contains an entryboolean put(K key, V value)
Some multimap implementations allow duplicate key-value pairs, in which
case put
always adds a new key-value pair and increases the
multimap size by 1. Other implementations prohibit duplicates, and storing
a key-value pair that's already in the multimap has no effect.
key
- - map keyvalue
- - map valuetrue
if the method increased the size of the multimap, or
false
if the multimap already contained the key-value pair and
doesn't allow duplicatesboolean remove(Object key, Object value)
key
and the value
value
from this multimap, if such exists. If multiple key-value
pairs in the multimap fit this description, which one is removed is
unspecified.key
- - map keyvalue
- - map valuetrue
if the multimap changedboolean putAll(K key, Iterable<? extends V> values)
values
, all
using the same key, key
. Equivalent to (but expected to be more
efficient than):
for (V value : values) {
put(key, value);
}
In particular, this is a no-op if values
is empty.
key
- - map keyvalues
- - map valuestrue
if the multimap changedCollection<V> replaceValues(K key, Iterable<? extends V> values)
If values
is empty, this is equivalent to
removeAll(key)
.
key
- - map keyvalues
- - map valuesCollection<V> removeAll(Object key)
key
.
Once this method returns, key
will not be mapped to any values
Use fastRemove(K...)
if values are not needed.
key
- - map keyvoid clear()
Collection<V> get(K key)
key
in this
multimap, if any. Note that when containsKey(key)
is false, this
returns an empty collection, not null
.
Changes to the returned collection will update the underlying multimap, and vice versa.
key
- - map keyCollection<V> getAll(K key)
key
- - map keySet<K> keySet()
Changes to the returned set will update the underlying multimap, and vice versa. However, adding to the returned set is not possible.
int keySize()
Collection<V> values()
values().size() == size()
).
Changes to the returned collection will update the underlying multimap, and vice versa. However, adding to the returned collection is not possible.
Collection<Map.Entry<K,V>> entries()
Map.Entry
instances.
Changes to the returned collection or the entries it contains will update the underlying multimap, and vice versa. However, adding to the returned collection is not possible.
long fastRemove(K... keys)
keys
from map by one operation
Works faster than RMultimap.remove
but not returning
the value associated with key
keys
- - map keysCopyright © 2014–2020 Redisson. All rights reserved.