edu.utexas.its.eis.tools.qwicap.template.xml
Interface MarkupEnumeration

All Superinterfaces:
Cloneable, Enumeration<Range>, Iterator<Range>
All Known Implementing Classes:
DescendantEnumerator

public interface MarkupEnumeration
extends Enumeration<Range>, Iterator<Range>, Cloneable

The MarkupEnumeration interface defines the basic functionality required from all of the various enumerators that provide access to the elements of Markup objects. Internally, the most significant quality of this interface is that it mandates support for cloning, which allows an enumeration-in-progress to be cloned so that it can be passed to something that does specialized processing on some subset of the original enumeration, and when that's complete, the original enumeration can resume where it left-off.

Author:
Chris W. Johnson

Method Summary
 MarkupEnumeration clone()
          Clones this enumeration.
 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.
 Range nextRange()
          Returns the next Range (the parent interface of all markup elements) in the Markup that is being enumerated.
 
Methods inherited from interface java.util.Enumeration
hasMoreElements, nextElement
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

nextRange

Range nextRange()
                throws NoSuchElementException
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.

Returns:
The next Range (the parent class of all markup elements) in the Markup that is being enumerated.
Throws:
NoSuchElementException - If this enumeration has been asked to return a Range after the final Range.

getMarkup

Markup getMarkup()
Returns the Markup object that is being enumerated.

Returns:
The Markup object that is being enumerated.

getIndex

int getIndex()
Returns the index of the most recently returned markup element within the Markup object's internal list of elements.

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

getMatch

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.

Returns:
A Match object identifying the element most recently returned by nextElement or nextRange.

clone

MarkupEnumeration clone()
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.

Returns:
A clone of this enumeration.