commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Steitz <p...@steitz.com>
Subject Re: [collections] MultiKeyMap
Date Sun, 11 Apr 2004 05:54:16 GMT
Stephen Colebourne wrote:
> I am currently developing a MultiKeyMap for [collections]. This class
> operates like a Map, but has multiple keys instead of one.
> get(key1, key2, key3)
> put(key1, key2, key3, value)
> (choice of 2-5 keys as per MultiKey)
> 
> I have made the class implement Map, however no-one will want to ever use it
> as a Map (ie. hold it in a Map variable). So, I could
> 
> 1) Place the class in the map subpackage, because its map-like
> 
> 2) Place the class in the main package, alongside MultiMap (the multi value
> map)
> 
> 3) Create a new subpackage, together with a new interface
> 
> #3 seems like a lot of work, especially as we have little evidence of what
> the interface really needs to be. #1 would make sense, except that every
> other class in the map subpackage truly is a map. So I'm tending towards #2,
> to join ArrayStack, BeanMap and MultiHashMap as the weird collections ;-)
> 
> Any other views?

Why do you we need this when we have MultiKeys available -- i.e., what do 
you gain by using multiple keys instead of a single MultiKey?  Sorry if I 
am being dense here, but I don't understand what disaggregation of the 
MultiKey is buying us.

Phil

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



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


Mime
View raw message