Defines a map that holds a collection of values against each key.
A
MultiMap
is a Map with slightly different semantics.
Putting a value into the map will add the value to a Collection at that
key. Getting a value will always return a Collection, holding all the
values put to that key. This implementation uses an ArrayList as the
collection.
For example:
MultiMap mhm = new MultiHashMap();
mhm.put(key, "A");
mhm.put(key, "B");
mhm.put(key, "C");
Collection coll = (Collection) mhm.get(key);
coll
will be a list containing "A", "B", "C".
Removes a specific value from map.
The item is removed from the collection mapped to the specified key.
MultiMap
is a Map with slightly different semantics. Putting a value into the map will add the value to a Collection at that key. Getting a value will always return a Collection, holding all the values put to that key. This implementation uses an ArrayList as the collection. For example:coll
will be a list containing "A", "B", "C".