commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michal Plechawski" <>
Subject Re: [Collections][SUBMIT] TypedList
Date Tue, 30 Apr 2002 15:34:31 GMT

> Just being Devil's advocate for a moment but....
> Couldn't this kind of thing be done with custom Comparators and (say)
> TreeMap?

Of course it could. But everyone knows that HashMap is much more efficient
than TreeMap, and so is the wrapper I described. This allows not to be
constrained to particular Map implementation.
Another thing is that I do not understand the real use case laying behind
the discussed Transform-xxx. I do not see why somebody wants to put
transformed elements into a collection, but ask for them directly. It breaks
some natural laws, like:

map.put(x, y);
map.containsKey(x); // this should be true

I think that this may be very misleading for many people, and be the reason
of hard-to-find errors. IMHO this idea breaks basic Collection Framework

However, this Predicate-xxx stuff is a completely different story and a good
idea I think.


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

View raw message