BiIterable?

Peter Levart peter.levart at gmail.com
Thu Jun 13 07:26:01 PDT 2013


On 06/13/2013 02:45 PM, Remi Forax wrote:
>> >public interface BiIterable<T, U> {
>> >       void forEach(BiConsumer<? super T, ? super U> action);
>> >}
>> >
>> >
>> >Which could be used as a super-interface for Map:
>> >
>> >public interface Map<K,V> extends BiIterable<K, V> { ...
>> >
>> >
>> >... in analogous way that Iterable<T> is super-interface of Collection<T>.
>> >
> BiIterable is a functional interface so one can write
>     BiIterable<String,String> biIterable = map::forEach;
>
> thus I don't think there is a need to put this interface in the JDK.
>
Ok, I agree.

Regards, Peter


More information about the lambda-dev mailing list