public class HashMapMulti<K,V> extends Object
Constructor and Description |
---|
HashMapMulti()
Construct an empty map.
|
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V value)
Add a value to a key's value set.
|
boolean |
containsKey(K key)
Test if this map has a mapping for a given key.
|
HashSetMulti<V> |
getMulti(K key)
Return the set of values for some key.
|
Set<K> |
keys()
Get the set of keys for this map.
|
void |
remove(K key)
Remove a key's entire value set.
|
void |
remove(K key,
V value)
Remove a value from a key's value set.
|
Iterable<V> |
values()
Return an iterable that can iterate over all the values of all the keys
in this map.
|
public void add(K key, V value)
key
- The key for the value to add.value
- The value that should be added to 'key's value setpublic boolean containsKey(K key)
key
- The key whose potential mapping is of interest.public HashSetMulti<V> getMulti(K key)
key
- The key for the set of values desired.public void remove(K key, V value)
key
- The key for the value set to remove from.value
- The value that should be removed from 'key's value
setpublic void remove(K key)
key
- The key for the set of values to remove.Copyright © 2017. All rights reserved.