commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
Subject Re: [Collections][SUBMIT] TypedList
Date Tue, 30 Apr 2002 22:11:13 GMT
From: Michal Plechawski <>
> 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
> 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
> of hard-to-find errors. IMHO this idea breaks basic Collection Framework
> intuitions.

The discussion in the WeakHashSet thread seemed to conclude that all input
into the collection would be transformed by the inputTransformer, and all
output would be transformed by the outputTransformer.

It will be important to support the case:
List list = TransformUtils.transformList(inputTransformer,
Integer i = (Integer) list.get(0);
This is needed where the list is to contain objects of one type (Integer in
this example) but is to accept a variety of input types. (I submitted a type
conversion package ages back for this kind of thing, but it didn't get

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

Coming soon...


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

View raw message