commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Achim Westermann <a.westerm...@alkacon.com>
Subject Re: MultiMap?
Date Wed, 14 Sep 2005 10:46:21 GMT
Thanks Adrei,

I looked into viewcvs and understood.


Andrei Polushin wrote:

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

Please not! The factory / decorator methods e.g. in MultiMap are documented well, but for
more 
information it's OK to be able to look them up.
I'd still vote for putting any Map subtype in the subpackage. With no effort one could add

public static Map multiMap();

to MapUtils and in there create a new instance (while the MultiHashMap is sent back to the

subpackage). The fact that it is no decoration but a specialization is of no interest for
the user 
as long as he knows how to obtain an instance. Personally I don't see much difference between

decoration by delegation to member of same supertyp and "decoration" by extending supertype
and 
override methods with super - delegation and further constraints / behaviours. Porting MultiHashMap

to the common decorator - pattern is formal work without special effort.

BTW: Does anyone know if there is a remarkable performance gap between collections by decoration
/ 
collections by specialization?

kind regards,

Achim


> -- 
> Andrei Polushin
> 
> Achim Westermann writes:
> 
>> Thanks Henning,
>>
>> I did not find it because I searched in the 
>> org.apache.commons.collections.map 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 <a.westermann@alkacon.com> 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?
>>>
>>>
>>> http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_1/org/apache/commons/collections/MultiMap.html

>>>
>>> http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_1/org/apache/commons/collections/MultiHashMap.html

>>>
>>> --- 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: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


-- 
Achim Westermann
-------------------

Alkacon Software
http://www.alkacon.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message