gov.llnl.babel.xml

Class ElementIterator

Implemented Interfaces:
Iterator

public class ElementIterator
extends java.lang.Object
implements Iterator

This iterator will enumerate all of the direct children elements of the parent element with the specified name. The remove method is not supported.

Constructor Summary

ElementIterator(Element parent, String name)
Create an iterator that will enumerate the children elements of the parent with the specified name.

Method Summary

boolean
hasNext()
Return true if there is a next matching element and false otherwise.
Object
next()
Return the current element or null if there are no more matching elements.
void
remove()
The remove method is not supported and will throw an unsupported operation exception.

Constructor Details

ElementIterator

public ElementIterator(Element parent,
                       String name)
Create an iterator that will enumerate the children elements of the parent with the specified name.

Method Details

hasNext

public boolean hasNext()
Return true if there is a next matching element and false otherwise.

next

public Object next()
Return the current element or null if there are no more matching elements. Advance the iterator to point to the next element.

remove

public void remove()
The remove method is not supported and will throw an unsupported operation exception.