Just being Devil's advocate for a moment but.... Couldn't this kind of thing be done with custom Comparators and (say) TreeMap?
James ----- Original Message ----- From: "Michal Plechawski" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Tuesday, April 30, 2002 10:00 AM Subject: Re: [Collections][SUBMIT] TypedList > Hello, > > I would like to give an use case for "TransformedMap", that may need > changing a concept a bit. > Let's say we want to have a map mapping case-insensitive Strings to > anything. We could just put them with s.toLowerCase(), and when checking > whether a key exists or getting its value we could use toLowerCase(), too. > However, this easily may lead to some hard-to-find errors, it bloats the > code etc. > My idea was to - like in the TransformMap - hide the transformation in the > wrapper class. However, the best way to do that in my case was to do that > _consequently_ for all Map interface methods - putting to the map, getting > values, getting entry or key sets etc. A kind of completely "transparent" > transformation. > That could be useful in any case when we need to "normalize" objects in some > way, and use "normalized" ones instead of arbitrary ones. This would apply > primarily to maps and sets, but not only of course. However, I do not see > why the uconsequent solution (ie. transforming map keys only when putting > them to the map) could be useful. > > Michal Plechawski > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>