Groovy Documentation

org.jdesktop.dom
[Java] Class SimpleHtmlCollection

java.lang.Object
  org.jdesktop.dom.SimpleHtmlCollection
All Implemented Interfaces:
org.w3c.dom.html.HTMLCollection, Iterable

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.

Authors:
rbair


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

list

private org.w3c.dom.html.HTMLCollection list


 
Constructor Detail

SimpleHtmlCollection

public SimpleHtmlCollection(org.w3c.dom.html.HTMLCollection list)
Creates a new instance of SimpleHtmlCollection.
Parameters:
list - the HTMLCollection to wrap.


 
Method Detail

getLength

public int getLength()
inheritDoc:


item

public org.w3c.dom.Node item(int index)
inheritDoc:


iterator

public Iterator iterator()
inheritDoc:


namedItem

public org.w3c.dom.Node namedItem(String name)


 

Groovy Documentation