commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasenjit Sen" <Prasenjit....@sas.com>
Subject RE: [Collections] MultiKeyMap vs concatenating keys that are strings
Date Fri, 21 Oct 2005 18:56:16 GMT
I guess right of the bat your keys cannot contain the _ character.
A regular hash map key must support the hashCode method that matches its equals method.

My understanding is that the MultiKey map does this for you automatically. It also allows
using non String objects as key components.
 

-----Original Message-----
From: Mark Shifman [mailto:mark.shifman@yale.edu] 
Sent: Friday, October 21, 2005 2:09 PM
To: Jakarta Commons Users List
Subject: [Collections] MultiKeyMap vs concatenating keys that are strings

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