commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [collections] CaseInsensitiveHashMap
Date Mon, 24 Nov 2003 15:03:45 GMT

--- Brian S O'Neill <broneill@earthlink.net> wrote:
> This implementation converts the key to lowercase on every get and put, 
> which adds a bit of object allocation overhead. 

How else would you accomplish the class' goal?

> Also, simply converting 
> to lowercase does not make it fully case-insensitive. There is a comment
> 
> in String.regionMatches that brings up something about the Georgian 
> alphabet.

I couldn't find any such comment in the javadocs
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#regionMatches(boolean,
int, java.lang.String, int, int)

> 
> What I always do when I want a case-insensitive map is to construct a 
> TreeMap with String.CASE_INSENSITIVE_ORDER.

We don't want a sorted Map implementation, just an implementation with
case insensitive Strings as keys.  Also, TreeMap is known to be much
slower than HashMap.

David

> 
> Phil Steitz wrote:
> 
> > A few weeks back, David Graham submitted code for a 
> > CaseInsensitiveHashMap here:
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24537
> >
> > This looks like a good addition to [collections] to me.
> >
> > Any objections to my coding up some tests and adding this class to the
> 
> > map package?
> >
> > Phil
> >
> >
> > ---------------------------------------------------------------------
> > 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
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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