Phillip Rhodes wrote:
> 1)  Is there any Map type of Container that allows me to have
> duplicate keys that have different payloads (different values in the
> value portion?
>
> 2)  Is there a way that I can do an Intersection between two of these
> maps and get the value portion of the map into an Collection type of
> container?


Take a look at the org.apache.commons.collections.MultiHashMap class. I think this will solve your 1st problem.


As for your 2nd problem, I don't know of a solution that is as convenient as your example. However, you could do:

((Collection)map1.get("1)").retainAll((Collection)map2.get("1"))

And I think that would do what you want.


Maybe a patch adding


MultiMap.retainAll(Collection)
MultiMap.removeAll(Collection)

would be considered?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to