issrg.utils.xml
Class ChildIterator

java.lang.Object
  extended by issrg.utils.xml.ChildIterator
All Implemented Interfaces:
java.util.Iterator<org.w3c.dom.Node>

public final class ChildIterator
extends java.lang.Object
implements java.util.Iterator<org.w3c.dom.Node>

Class implementing the Iterator interface to allow fast iterating over the child nodes of an element.

Author:
sfl

Constructor Summary
ChildIterator(org.w3c.dom.Node parent)
          Construct the iterator.
 
Method Summary
 boolean hasNext()
          Checks whether this iterator can return an additional element.
 org.w3c.dom.Node next()
          Returns the next child of the given parent node.
 void remove()
          The remove operation is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildIterator

public ChildIterator(org.w3c.dom.Node parent)
Construct the iterator.

Parameters:
parent - a Node whose children will be iterated over. Should not be null.
Method Detail

hasNext

public boolean hasNext()
Checks whether this iterator can return an additional element.

Specified by:
hasNext in interface java.util.Iterator<org.w3c.dom.Node>
Returns:
true if the iterator has an additional element, false otherwise.

next

public org.w3c.dom.Node next()
Returns the next child of the given parent node.

Specified by:
next in interface java.util.Iterator<org.w3c.dom.Node>
Returns:
the next child of the parent node.

remove

public void remove()
The remove operation is not supported.

Specified by:
remove in interface java.util.Iterator<org.w3c.dom.Node>
Throws:
java.lang.UnsupportedOperationException