commons-dev mailing list archives

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

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

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

Regards,
Michal



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message