commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collections] CaseInsensitiveHashMap
Date Sat, 03 Jan 2004 23:46:40 GMT
From: "Phil Steitz" <phil@steitz.com>
> <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

Maybe I'm making more out of this than I need...

Stephen


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