Enumeration adapters in SE 8

Sebastian Sickelmann sebastian.sickelmann at gmx.de
Fri Aug 26 15:24:32 PDT 2011


Paul Benedict wrote:
>Another solution is for the JDK to add an Enumeration/Iterator adapter
>class; then just instantiate it during compiler desugaring.

May be this is something for project coin in jdk8? Is there a coin in 8?
Is there someone who wants to send in an coin-proposal with me for this?

>
>
>On Wed, Aug 24, 2011 at 3:34 PM, Stephen Colebourne
><scolebourne at joda.org  <http://mail.openjdk.java.net/mailman/listinfo/lambda-dev>>  wrote:
>>/  On 24 August 2011 19:10, Dan Smith<daniel.smith at oracle.com  <http://mail.openjdk.java.net/mailman/listinfo/lambda-dev>>  wrote:
/>>>/  I was pointed to some comments on core-libs about adapting Enumerations to for loops in SE 8.  (Sorry for the new>thread -- I wasn't subscribed.)  It turns out lambdas + extension methods will make this very easy.
/>>>/
>/>>/  In the API:
/>>>/
>/>>/  interface Enumeration<E>  extends Iterator<E>  {
/>>>/    boolean hasMoreElements();
/>>>/    E nextElement();
/>>>/    boolean hasNext() default #hasMoreElements;
/>>>/    E next() default #nextElement;
/>>>/    void remove() default { throw new UnsupportedOperationException(); }
/>>>/  }
/>>/
>/>/  This seems sensible.
/>>/
>/>/  Is this made up syntax, or another EG decision?
/>>/    void remove() default { throw new UnsupportedOperationException(); }
/>>/
>/>/  Stephen
/>>



More information about the lambda-dev mailing list