foreach/filter/map/reduce on Iterable & Iterators
Rémi Forax
forax at univ-mlv.fr
Thu Sep 15 08:50:08 PDT 2011
On 09/15/2011 04:46 PM, Colin Decker wrote:
> Also, you can pass a Mapper<? super MyType, ? extends MyOtherType> to map
> even if it takes Mapper<? super T, U>. The result is just going to be an
> Iterable<? extends MyOtherType>. That is the actual type of the resulting
> Iterable and it's no less usable than if you called it an
> Iterable<MyOtherType>.
true for Iterable not for Collection,
and why the hell do you want to write wildcards in the user code.
The idea is to use wildcards in the API code to don't bother the user.
Rémi
More information about the lambda-dev
mailing list