Thanks Lothar for your reply, Sorry, you're right, I meant why doesn't it support java.lang.Iterable (and implement a method iterator()) that can be used in a for each loop,
Cheers for your suggestion about looking in the forums for the same question regarding the java.awt.List / java.swing.JList, I'll check that out Simon On Feb 2, 6:38 am, Lothar Kimmeringer <[email protected]> wrote: > Simon B schrieb: > > > I apologise if this is a stupid question, or If I'm missing something, > > but why doesn't > > com.google.gwt.xml.client.NodeList > > extend > > java.util.Iterator > > Because no List (java.util.List or java.awt.List) do. > > > it would be handy as then NodeList could be used with the shortened > > for each block a la: > > for (Node aNode : nodeList) { > > So you mean java.util.Iterable as being described e.g. > inhttp://java.sun.com/j2se/1.5.0/docs/api/java/lang/Iterable.html > > > Rather than > > for (int i = 0; i < nodeList.length(); i++) { > > Node aNode = nodeList.item(i); > > .... > > } > > It seems a really obvious oversight, so I'm sure that there's a good > > reason, I'd just like to know what it is. > > I don't know the reason but you might ask SUN, why they don't do > the same for their GUI-elements > likehttp://java.sun.com/j2se/1.5.0/docs/api/java/awt/List.html > orhttp://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JList.html > > Regards, Lothar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
