Stephen Colebourne wrote:
From: "Phil Steitz" <[EMAIL PROTECTED]>

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

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?


Phil

Stephen


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to