Open SiteSearch 4.1.1
Final

ORG.oclc.xml.om
Class ElementEnumeration

java.lang.Object
  |
  +--ORG.oclc.xml.om.ElementEnumeration

public class ElementEnumeration
extends Object
implements Enumeration

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.

See Also:
Element, Name

Constructor Summary
ElementEnumeration(Element root)
          Creates a new enumerator for enumerating over all of the children of the given root node.
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.
 
Method Summary
 boolean hasMoreElements()
          Determines if there are any more matching elements.
 Object nextElement()
          Retrieves the next matching element.
 void reset()
          Resets the iterator so that you can iterate through the elements again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementEnumeration

public ElementEnumeration(Element root)
Creates a new enumerator for enumerating over all of the children of the given root node.
Parameters:
root - The element whose children are going to be enumerated.

ElementEnumeration

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.
Parameters:
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.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Determines if there are any more matching elements.
Specified by:
hasMoreElements in interface Enumeration
Returns:
true if the next call to nextElement will return a non-null result.

nextElement

public Object nextElement()
Retrieves the next matching element.
Specified by:
nextElement in interface Enumeration
Returns:
Element or null if there are no more matching elements.

reset

public void reset()
Resets the iterator so that you can iterate through the elements again.
Returns:
No return value.

Open SiteSearch 4.1.1
Final