Module org.htmlunit

Class DomNode.AbstractDescendantIterator<T extends DomNode>

java.lang.Object
org.htmlunit.html.DomNode.AbstractDescendantIterator<T>
Type Parameters:
T - the element type
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
DomNode.DescendantDomElementsIterator, DomNode.DescendantHtmlElementsIterator
Enclosing class:
DomNode

protected abstract class DomNode.AbstractDescendantIterator<T extends DomNode> extends Object implements Iterator<T>
Iterates over all descendants DomElements, in document order.
  • Constructor Details

    • AbstractDescendantIterator

      protected AbstractDescendantIterator()
      Creates a new instance which iterates over the specified node type.
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T extends DomNode>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T extends DomNode>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T extends DomNode>
    • nextNode

      public T nextNode()
      Returns the next node in the iteration.
      Returns:
      the next node, or null if there are no more nodes
    • isAccepted

      protected abstract boolean isAccepted(DomNode node)
      Indicates if the node is accepted. If not it won't be explored at all.
      Parameters:
      node - the node to test
      Returns:
      true if accepted