Class DTMDefaultBaseIterators.PrecedingIterator

All Implemented Interfaces:
Cloneable, DTMAxisIterator
Enclosing class:
DTMDefaultBaseIterators

public class DTMDefaultBaseIterators.PrecedingIterator extends DTMDefaultBaseIterators.InternalAxisIteratorBase
Iterator that returns preceding nodes of a given node. This includes the node set {root+1, start-1}, but excludes all ancestors, attributes, and namespace nodes.
  • Field Details

    • _stack

      protected int[] _stack
      The stack of start node + ancestors up to the root of the tree, which we must avoid.
    • _sp

      protected int _sp
      (not sure yet... -sb)
    • _oldsp

      protected int _oldsp
      (not sure yet... -sb)
  • Constructor Details

    • PrecedingIterator

      public PrecedingIterator()
  • Method Details

    • isReverse

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

      public DTMAxisIterator cloneIterator()
      Returns a deep copy of this iterator. Cloned iterators may not be restartable. The iterator being cloned may or may not become non-restartable as a side effect of this operation.
      Specified by:
      cloneIterator in interface DTMAxisIterator
      Overrides:
      cloneIterator in class DTMAxisIteratorBase
      Returns:
      a deep copy of this iterator.
    • setStartNode

      public void setStartNode(int node)
      Set start to END should 'close' the iterator, i.e. subsequent call to next() should return END.
      Parameters:
      node - Sets the root of the iteration.
    • next

      public int next()
      Get the next node in the iteration.
      Returns:
      The next node handle in the iteration, or END.
    • reset

      public void reset()
      Resets the iterator to the last start node.
      Specified by:
      reset in interface DTMAxisIterator
      Overrides:
      reset in class DTMAxisIteratorBase