rajrembo / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

Request: Iterables.transform returns appropriate view for argument #207

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice if Iteratables.transform would return Lists.transform or 
Collections2.transform if the argument was of the appropriate type. The main 
benefit to me in this case would be efficiency for calls like Iterables.size on 
the returned value.

Original issue reported on code.google.com by a...@bryzak.net on 17 Jul 2009 at 8:01

GoogleCodeExporter commented 8 years ago
It's a basically defensible idea, and I have pondered this kind of thing many 
times,
but my general take on it is that it ruins your ability to specify the precise
semantics of the method, er, precisely.  I'd rather users knew exactly what 
they were
getting.  You're right that Iterables.size(Iterables.transform()) is pretty 
nasty,
but that should be fixed in the user's code.

Original comment by kevin...@gmail.com on 22 Jul 2009 at 10:04