Class DomNode.DescendantElementsIterator<T extends DomNode>

  • Type Parameters:
    T - the type of nodes over which to iterate
    All Implemented Interfaces:
    java.util.Iterator<T>
    Enclosing class:
    DomNode

    protected class DomNode.DescendantElementsIterator<T extends DomNode>
    extends java.lang.Object
    implements java.util.Iterator<T>
    Iterates over all descendants of a specific type, in document order.
    • Constructor Summary

      Constructors 
      Constructor Description
      DescendantElementsIterator​(java.lang.Class<T> type)
      Creates a new instance which iterates over the specified node type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      protected boolean isAccepted​(DomNode node)
      Indicates if the node is accepted.
      T next()
      T nextNode()  
      void remove()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • DescendantElementsIterator

        public DescendantElementsIterator​(java.lang.Class<T> type)
        Creates a new instance which iterates over the specified node type.
        Parameters:
        type - the type of nodes over which to iterate
    • Method Detail

      • hasNext

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

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

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

        public T nextNode()
        Returns:
        the next node, if there is one
      • isAccepted

        protected 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