public class ElementEnumeration implements >Enumeration { // Constructors public ElementEnumeration(Element root); public ElementEnumeration(Element root, Name tag, int type); // Methods public boolean hasMoreElements(); public Object nextElement(); public void reset(); }
This class is a simple Enumeration for iterating over the immediate children of a given node in the XML tree. This is not a hierarchical iterator. It does not walk the entire tree.
public ElementEnumeration(Element root);Creates a new enumerator for enumerating over all of the children of the given root node.
Parameter Description root The element whose children are going to be enumerated.
public ElementEnumeration(Element root, Name tag, int type);Creates a new enumerator for enumerating over the immediate children of the given root node that have matching tag names and/or types.
Parameter Description root The element whose children are going to be enumerated. tag The name of the tag; this parameter can be null if the name is not important. type The element type. Element.ELEMENT is the most common. If the element type is not important, pass -1.
public boolean hasMoreElements();Determines if there are any more matching elements.
Return Value
Returns true if the next call to nextElement will return a non-null result.
public Object nextElement();Retrieves the next matching element.
Return Value
Returns Element or null if there are no more matching elements.
public void reset();Resets the iterator so that you can iterate through the elements again.
Return Value
No return value.