commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [Collections][SUBMIT] TypedList
Date Tue, 30 Apr 2002 15:10:24 GMT
Just being Devil's advocate for a moment but....
Couldn't this kind of thing be done with custom Comparators and (say)

----- Original Message -----
From: "Michal Plechawski" <>
To: "Jakarta Commons Developers List" <>
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
> 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:
> For additional commands, e-mail:

Do You Yahoo!?
Get your free address at

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

View raw message