public class MultiMap<K,V> extends Object implements Serializable
| Constructor and Description |
|---|
MultiMap() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(K key) |
Set<V> |
get(K key) |
Set<V> |
getAndRemoveAll(K key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
void |
put(K key,
V value)
Stores a
key-value pair. |
boolean |
remove(K key,
V value)
Removes
key-value pair if it exists. |
void |
removeAll(K key)
Removes all values associated with
key. |
int |
size() |
public boolean containsKey(K key)
key - keytrue if at least one key-value pair exists
for keypublic boolean isEmpty()
true if emptypublic Set<V> get(K key)
key - keykeypublic Set<V> getAndRemoveAll(K key)
key - keykey then remove it from the container storagepublic boolean remove(K key, V value)
key-value pair if it exists.key - keyvalue - valuetrue if pair was removed, false otherwisepublic void removeAll(K key)
key.key - keypublic int size()
Copyright © 2021. All rights reserved.