Re: Enumeration adapters in SE 8

2011-08-25 Thread Ulf Zibis
Some other candidates for Iterable: Bug 6793773 - Let CharsetProvider implement Iterable Bug 6935695 - String should implement Iterable -Ulf Am 25.08.2011 10:19, schrieb

Re: Enumeration adapters in SE 8

2011-08-25 Thread mike . skells
...@openjdk.java.net Date: Wed, 24 Aug 2011 20:50:07 To: Collin Fagan Cc: core-libs-dev@openjdk.java.net; lambda-dev Subject: Re: Enumeration adapters in SE 8 The key advance would be the last one, unfortunately the one Dan says may not make it: allowing the for loop to take an Iterator. I had

Re: Enumeration adapters in SE 8

2011-08-24 Thread Andrew Thompson
The key advance would be the last one, unfortunately the one Dan says may not make it: allowing the for loop to take an Iterator. I had some legacy code in the last couple of weeks where I wanted to be able to process arbitrary sequences: arrays, iterables and iterators and I ended up copying

Re: Enumeration adapters in SE 8

2011-08-24 Thread Colin Decker
I've come across various scenarios. One example is javax.swing.tree.DefaultMutableTreeNode. It has numerous methods that return Enumerations, including: - children - depthFirstEnumeration - breadthFirstEnumeration - preorderEnumeration - postorderEnumeration - pathFromAncestorEnumeration I've crea

Enumeration adapters in SE 8

2011-08-24 Thread Dan Smith
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 extends Iterator { boolean hasMoreElements();