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 return a Collection, holding all the values put to that key.
For example:
MultiMap mhm = new MultiValueMap(); mhm.put(key, "A"); mhm.put(key, "B"); mhm.put(key, "C"); Collection coll = (Collection) mhm.get(key);
coll
will be a collection containing "A", "B", "C".
NOTE: Additional methods were added to this interface in Commons Collections 3.1. These were added solely for documentation purposes and do not change the interface as they were defined in the superinterface Map
anyway.
@since 2.0
@version $Id: MultiMap.java 1477779 2013-04-30 18:55:24Z tn $
|
|
|
|