Class XMLNodeListIterator

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

    public final class XMLNodeListIterator
    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 int index
      Store the next node
      private org.w3c.dom.NodeList nodelist
      The NodeList to iterate over.
    • Constructor Summary

      Constructors 
      Constructor Description
      XMLNodeListIterator​(org.w3c.dom.NodeList nl)
      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

      • index

        private int index
        Store the next node
      • nodelist

        private org.w3c.dom.NodeList nodelist
        The NodeList to iterate over.
    • Constructor Detail

      • XMLNodeListIterator

        public XMLNodeListIterator​(org.w3c.dom.NodeList nl)
        Constructor with first element to iterate over.
        Parameters:
        nl - NodeList to iterate over.
    • 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>