javax.swing.text.html
Class HTMLDocument.LeafIterator

java.lang.Object
  extended byjavax.swing.text.html.HTMLDocument.Iterator
      extended byjavax.swing.text.html.HTMLDocument.LeafIterator
Enclosing class:
HTMLDocument

static class HTMLDocument.LeafIterator
extends HTMLDocument.Iterator

An iterator to iterate over a particular type of tag.


Field Summary
private  int endOffset
           
private  ElementIterator pos
           
private  HTML.Tag tag
           
 
Constructor Summary
(package private) HTMLDocument.LeafIterator(HTML.Tag t, Document doc)
           
 
Method Summary
 AttributeSet getAttributes()
          Returns the attributes for this tag.
 int getEndOffset()
          Returns the end of the range for which the current occurrence of the tag is defined and has the same attributes.
 int getStartOffset()
          Returns the start of the range for which the current occurrence of the tag is defined and has the same attributes.
 HTML.Tag getTag()
          Returns the type of tag this iterator represents.
 boolean isValid()
          Returns true if the current position is not null.
 void next()
          Moves the iterator forward to the next occurrence of the tag it represents.
(package private)  void nextLeaf(ElementIterator iter)
          Moves the given iterator to the next leaf element.
(package private)  void setEndOffset()
          Marches a cloned iterator forward to locate the end of the run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endOffset

private int endOffset

tag

private HTML.Tag tag

pos

private ElementIterator pos
Constructor Detail

HTMLDocument.LeafIterator

HTMLDocument.LeafIterator(HTML.Tag t,
                          Document doc)
Method Detail

getAttributes

public AttributeSet getAttributes()
Returns the attributes for this tag.

Specified by:
getAttributes in class HTMLDocument.Iterator
Returns:
the AttributeSet for this tag, or null if none can be found

getStartOffset

public int getStartOffset()
Returns the start of the range for which the current occurrence of the tag is defined and has the same attributes.

Specified by:
getStartOffset in class HTMLDocument.Iterator
Returns:
the start of the range, or -1 if it can't be found

getEndOffset

public int getEndOffset()
Returns the end of the range for which the current occurrence of the tag is defined and has the same attributes.

Specified by:
getEndOffset in class HTMLDocument.Iterator
Returns:
the end of the range

next

public void next()
Moves the iterator forward to the next occurrence of the tag it represents.

Specified by:
next in class HTMLDocument.Iterator

getTag

public HTML.Tag getTag()
Returns the type of tag this iterator represents.

Specified by:
getTag in class HTMLDocument.Iterator
Returns:
the HTML.Tag that this iterator represents.
See Also:
HTML.Tag

isValid

public boolean isValid()
Returns true if the current position is not null.

Specified by:
isValid in class HTMLDocument.Iterator
Returns:
true if current position is not null, otherwise returns false

nextLeaf

void nextLeaf(ElementIterator iter)
Moves the given iterator to the next leaf element.

Parameters:
iter - the iterator to be scanned

setEndOffset

void setEndOffset()
Marches a cloned iterator forward to locate the end of the run. This sets the value of endOffset.