commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <>
Subject Re: [collections] CaseInsensitiveHashMap
Date Sun, 04 Jan 2004 00:37:36 GMT
Stephen Colebourne wrote:
> From: "Phil Steitz" <>
>><side comment>
>>It is interesting to note that what is going on here is that a
>>CaseInsensitiveMap is a map on equivalence classes of keys and the design
>>question is whether to store canonical equivalence class representatives
>>and use canonicalized access functions or to implement the equivalence
>>relation internally.  The advantage of the second approach is that you can
>>recover the keys exactly as they have been entered, the disadvantage is
>>that one-time canonicalization may be more efficient.
>></side comment>
> There is another possibility. Store both the original and lower case key in
> the Entry. (Subclass HashEntry with an extra lowerCaseKey field) isEqualKey
> then checks against the lowerCaseKey

Yes, I thought about that, but that would obviously increase storage 
> Maybe I'm making more out of this than I need... >

In this case, I think so.  The user of this class is explicitly ignoring 
case differences. I can't imagine a use case where it would make a 
practical difference that keySet() returns all lowercase strings. Can you?


> Stephen
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message