Design for collections upgrades

Rémi Forax forax at univ-mlv.fr
Thu Mar 10 06:02:27 PST 2011


  Le 10/03/2011 13:19, Peter Levart a écrit :
> On 03/10/11, Zdeněk Troníček wrote:
>> >  To me it seems logical that filter() returns the same collection as was
>> >  the original collection.
> But that is rarely what you want by default. The eager result you get from filter() is usualy just an intermediate representation of some data. Think of this, for example:
>
> ConcurrentMap cMap = ...;
>
> Set someKeys = cMap.keys().filter(...);
>
>
> Would you usually want someKeys to be backed by a separate instance of ConcurrentHashMap?
>
> Peter

Peter, I have some problem to understand what is your position.
Does  cMap.keys().filter(...) return a set or an iterable ?

Rémi



More information about the lambda-dev mailing list