edu.utexas.its.eis.tools.qwicap.template.xml
Class DescendantEnumerator

java.lang.Object
  extended by edu.utexas.its.eis.tools.qwicap.template.xml.DescendantEnumerator
All Implemented Interfaces:
MarkupEnumeration, Cloneable, Enumeration<Range>, Iterator<Range>

public final class DescendantEnumerator
extends Object
implements MarkupEnumeration

DescendantEnumerator provides a convenient means of enumerating some, or all, of a body of XML markup while maintaining an awareness of each tag's context in the tag hierarchy. The elements it enumerates are determined by the MarkupEnumeration object passed to its constructor.

Author:
Chris W. Johnson

Constructor Summary
DescendantEnumerator(MarkupEnumeration Elems)
           
DescendantEnumerator(MarkupEnumeration Elems, boolean ReturnEndTags)
           
 
Method Summary
 DescendantEnumerator clone()
          Clones this enumeration.
 int getChildNo()
           
 int getIndex()
          Returns the index of the most recently returned markup element within the Markup object's internal list of elements.
 Markup getMarkup()
          Returns the Markup object that is being enumerated.
 Match getMatch()
          Returns a Match object uniquely identifying the occurrence of the most recently returned markup element within the the Markup object that is being enumerated.
 int getParentCount()
           
 boolean hasMoreElements()
           
 boolean hasNext()
           
 Range next()
           
 Range nextElement()
           
 Range nextRange()
          Returns the next Range (the parent interface of all markup elements) in the Markup that is being enumerated.
 void print()
           
 void print(boolean PrintChildNos)
           
 void remove()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescendantEnumerator

public DescendantEnumerator(MarkupEnumeration Elems)

DescendantEnumerator

public DescendantEnumerator(MarkupEnumeration Elems,
                            boolean ReturnEndTags)
Method Detail

getMarkup

public Markup getMarkup()
Description copied from interface: MarkupEnumeration
Returns the Markup object that is being enumerated.

Specified by:
getMarkup in interface MarkupEnumeration
Returns:
The Markup object that is being enumerated.

getParentCount

public int getParentCount()

getChildNo

public int getChildNo()

getIndex

public int getIndex()
Description copied from interface: MarkupEnumeration
Returns the index of the most recently returned markup element within the Markup object's internal list of elements.

Specified by:
getIndex in interface MarkupEnumeration
Returns:
The Markup object's internal index number for the element most recently returned by nextElement or nextRange.

getMatch

public Match getMatch()
Description copied from interface: MarkupEnumeration
Returns a Match object uniquely identifying the occurrence of the most recently returned markup element within the the Markup object that is being enumerated.

Specified by:
getMatch in interface MarkupEnumeration
Returns:
A Match object identifying the element most recently returned by nextElement or nextRange.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Range>

next

public Range next()
Specified by:
next in interface Iterator<Range>

remove

public void remove()
Specified by:
remove in interface Iterator<Range>

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface Enumeration<Range>

nextElement

public Range nextElement()
Specified by:
nextElement in interface Enumeration<Range>

nextRange

public Range nextRange()
Description copied from interface: MarkupEnumeration
Returns the next Range (the parent interface of all markup elements) in the Markup that is being enumerated. This is equivalent to the nextElement method, except for its return type.

Specified by:
nextRange in interface MarkupEnumeration
Returns:
The next Range (the parent class of all markup elements) in the Markup that is being enumerated.

clone

public DescendantEnumerator clone()
Description copied from interface: MarkupEnumeration
Clones this enumeration. Typically this is done so that other code can begin processing at this point in the Markup, without interfering with the ability of the code that created the enumeration to continue its processing of the Markup.

Specified by:
clone in interface MarkupEnumeration
Overrides:
clone in class Object
Returns:
A clone of this enumeration.

print

public void print()

print

public void print(boolean PrintChildNos)