Class XMLNodeIterator

  • All Implemented Interfaces:
    java.util.Iterator<org.w3c.dom.Node>

    public final class XMLNodeIterator
    extends java.lang.Object
    implements java.util.Iterator<org.w3c.dom.Node>
    Simple adapter class to iterate over a DOM tree nodes children.
    Since:
    0.2
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.w3c.dom.Node next
      Store the next node
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLNodeIterator​(org.w3c.dom.Node first)
      Constructor with first element to iterate over.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Check if the next node is defined.
      org.w3c.dom.Node next()
      Return next and advance iterator.
      • 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, remove
    • Field Detail

      • next

        private org.w3c.dom.Node next
        Store the next node
    • Constructor Detail

      • XMLNodeIterator

        public XMLNodeIterator​(org.w3c.dom.Node first)
        Constructor with first element to iterate over.
        Parameters:
        first - first child of parent node.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Check if the next node is defined.
        Specified by:
        hasNext in interface java.util.Iterator<org.w3c.dom.Node>
      • next

        public org.w3c.dom.Node next()
        Return next and advance iterator.
        Specified by:
        next in interface java.util.Iterator<org.w3c.dom.Node>