Class ArrayNodeListIterator

  • All Implemented Interfaces:
    java.lang.Cloneable, DTMAxisIterator

    public class ArrayNodeListIterator
    extends java.lang.Object
    implements DTMAxisIterator
    • Constructor Detail

      • ArrayNodeListIterator

        public ArrayNodeListIterator​(int[] nodes)
    • Method Detail

      • next

        public int next()
        Description copied from interface: DTMAxisIterator
        Get the next node in the iteration.
        Specified by:
        next in interface DTMAxisIterator
        Returns:
        The next node handle in the iteration, or END.
      • reset

        public DTMAxisIterator reset()
        Description copied from interface: DTMAxisIterator
        Resets the iterator to the last start node.
        Specified by:
        reset in interface DTMAxisIterator
        Returns:
        A DTMAxisIterator, which may or may not be the same as this iterator.
      • getLast

        public int getLast()
        Specified by:
        getLast in interface DTMAxisIterator
        Returns:
        the number of nodes in this iterator. This may be an expensive operation when called the first time.
      • getPosition

        public int getPosition()
        Specified by:
        getPosition in interface DTMAxisIterator
        Returns:
        The position of the current node in the set, as defined by XPath.
      • setMark

        public void setMark()
        Description copied from interface: DTMAxisIterator
        Remembers the current node for the next call to gotoMark().
        Specified by:
        setMark in interface DTMAxisIterator
      • gotoMark

        public void gotoMark()
        Description copied from interface: DTMAxisIterator
        Restores the current node remembered by setMark().
        Specified by:
        gotoMark in interface DTMAxisIterator
      • setStartNode

        public DTMAxisIterator setStartNode​(int node)
        Description copied from interface: DTMAxisIterator
        Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
        Specified by:
        setStartNode in interface DTMAxisIterator
        Parameters:
        node - Sets the root of the iteration.
        Returns:
        A DTMAxisIterator set to the start of the iteration.
      • getStartNode

        public int getStartNode()
        Description copied from interface: DTMAxisIterator
        Get start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
        Specified by:
        getStartNode in interface DTMAxisIterator
        Returns:
        The root node of the iteration.
      • isReverse

        public boolean isReverse()
        Specified by:
        isReverse in interface DTMAxisIterator
        Returns:
        true if this iterator has a reversed axis, else false.
      • getNodeByPosition

        public int getNodeByPosition​(int position)
        Description copied from interface: DTMAxisIterator
        Return the node at the given position.
        Specified by:
        getNodeByPosition in interface DTMAxisIterator
        Parameters:
        position - The position
        Returns:
        The node at the given position.