commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <scolebou...@btopenworld.com>
Subject Re: [Collections] MultiKeyMap vs concatenating keys that are strings
Date Fri, 21 Oct 2005 19:54:32 GMT
The short answer is to say, this is open source, so look at the source ;-)

The longer answer is that MultiKeyMap uses specially optimised data 
structures internally to store the key parts. This avoids any hacky (and 
slow) string concatenation. Given a choice, I would always use a 
MultiKeyMap for a multiply-keyed map.

Stephen



Mark Shifman wrote:
> Hi:
> 
> If I am building a map with a compound key composed of say 3 strings , 
> is there any advantage to using MultiKeyMap over a regular Hash(ed)Map
> with the key = key1+"_"+key2+"_"+key3;
> 
> speed?..elegance??
> 
> thanks in advance
> mas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
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