Class DescendantAxisIterator

  • All Implemented Interfaces:
    java.util.Iterator
    Direct Known Subclasses:
    DescendantOrSelfAxisIterator

    public class DescendantAxisIterator
    extends java.lang.Object
    implements java.util.Iterator
    Represents the XPath descendant axis. The "descendant axis contains the descendants of the context node; a descendant is a child or a child of a child and so on; thus the descendant axis never contains attribute or namespace nodes."
    Version:
    1.2b12
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Iterator children  
      private Navigator navigator  
      private java.util.ArrayList stack  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Returns true if there are any descendants remaining; false otherwise.
      java.lang.Object next()
      Returns the next descendant node.
      void remove()
      This operation is not supported.
      • 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
    • Field Detail

      • stack

        private java.util.ArrayList stack
      • children

        private java.util.Iterator children
    • Constructor Detail

      • DescendantAxisIterator

        public DescendantAxisIterator​(java.lang.Object contextNode,
                                      Navigator navigator)
                               throws UnsupportedAxisException
        Create a new descendant axis iterator.
        Parameters:
        contextNode - the node to start from
        navigator - the object model specific navigator
        Throws:
        UnsupportedAxisException
      • DescendantAxisIterator

        public DescendantAxisIterator​(Navigator navigator,
                                      java.util.Iterator iterator)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Returns true if there are any descendants remaining; false otherwise.
        Specified by:
        hasNext in interface java.util.Iterator
        Returns:
        true if any descendants remain; false otherwise
        See Also:
        Iterator.hasNext()
      • next

        public java.lang.Object next()
        Returns the next descendant node.
        Specified by:
        next in interface java.util.Iterator
        Returns:
        the next descendant node
        Throws:
        java.util.NoSuchElementException - if no descendants remain
        See Also:
        Iterator.next()
      • remove

        public void remove()
        This operation is not supported.
        Specified by:
        remove in interface java.util.Iterator
        Throws:
        java.lang.UnsupportedOperationException - always