|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.jdesktop.dom.SimpleHtmlCollection
public class SimpleHtmlCollection extends Object
An implementation of org.w3c.dom.html.HTMLCollection which also implements Iterable. This allows you to use a SimpleHtmlCollection in an enhanced for loop, such as:
SimpleHtmlCollection nodes = ...;
for (Node n : nodes) {
System.out.println(n.getTextContent());
}
SimpleHtmlCollection wraps a source HtmlCollection. So any normal HTMLCollection can be adapted for use with enhanced for loops by wrapping it in a SimpleHtmlCollection.
| Field Summary | |
|---|---|
private org.w3c.dom.html.HTMLCollection |
list
|
| Constructor Summary | |
SimpleHtmlCollection(org.w3c.dom.html.HTMLCollection list)
Creates a new instance of SimpleHtmlCollection. |
|
| Method Summary | |
|---|---|
int
|
getLength()
@inheritDoc |
org.w3c.dom.Node
|
item(int index)
@inheritDoc |
Iterator
|
iterator()
@inheritDoc |
org.w3c.dom.Node
|
namedItem(String name)
|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private org.w3c.dom.html.HTMLCollection list
| Constructor Detail |
|---|
public SimpleHtmlCollection(org.w3c.dom.html.HTMLCollection list)
list - the HTMLCollection to wrap.
| Method Detail |
|---|
public int getLength()
public org.w3c.dom.Node item(int index)
public Iterator iterator()
public org.w3c.dom.Node namedItem(String name)
Groovy Documentation