commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Polushin <>
Subject Re: MultiMap?
Date Wed, 14 Sep 2005 08:20:15 GMT

The classes in 2nd-level packages (like in are 'decorators'. They are not 
interfaces (like MultiMap), and not self-contained implementations (like 
MultiHashMap). Most decorators are actually exposed as methods of 
MapUtils class, so an ordinary user does not need to worry about 
2nd-level packages at all, just import org.apache.commons.collections.* 
to get MultiMap, MultiHashMap, MapUtils and almost 98.3% of the 
functionality of commons-collections.

Probably, these 2nd-level packages should be documented separately, to 
avoid confusion.

Andrei Polushin

Achim Westermann writes:
> Thanks Henning,
> I did not find it because I searched in the 
> package. I knew the shifted semantics 
> of a multimap but after all it is still a map. Why isn't it put under 
> the package mentioned above? Wouldn't it be a good idea?
> kind regards,
> Achim
> Henning P. Schmiedehausen wrote:
>> Achim Westermann <> writes:
>>> Hi list users,
>>> As a newbie to commons collection I am searching for a MultiMap: A 
>>> Map with add (another value to key) and set (replace all old values 
>>> for key) operations that allows mapping multiple values to a single key.
>>> I just found a map with multiple keys for identical values...  A I 
>>> blind?


>> --- cut ---
>> 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.
>> --- cut ---
>>     Best regards
>>         Henning

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message