Interface AxisIterator<T extends NodeInfo>

All Superinterfaces:
SequenceIterator<T>, UnfailingIterator<T>
All Known Implementing Classes:
AncestorEnumeration, AncestorEnumeration, AttributeEnumeration, AttributeEnumeration, AxisIteratorImpl, AxisIteratorOverSequence, ChildEnumeration, DescendantEnumeration, DescendantEnumeration, EmptyAxisIterator, FollowingEnumeration, FollowingEnumeration, FollowingSiblingEnumeration, Navigator.AncestorEnumeration, Navigator.AxisFilter, Navigator.BaseEnumeration, Navigator.DescendantEnumeration, Navigator.EmptyTextFilter, Navigator.FollowingEnumeration, Navigator.PrecedingEnumeration, NodeWrappingAxisIterator, PrecedingEnumeration, PrecedingEnumeration, PrecedingOrAncestorEnumeration, PrecedingSiblingEnumeration, PrecedingSiblingEnumeration, PrependIterator, SiblingEnumeration, SingleNodeIterator, TreeEnumeration, VirtualCopy.VirtualCopier, VirtualUntypedCopy.VirtualUntypedCopier, WrappingIterator

public interface AxisIterator<T extends NodeInfo> extends UnfailingIterator<T>
A SequenceIterator is used to iterate over a sequence. An AxisIterator is a SequenceIterator that throws no exceptions, and that always returns nodes. The nodes should all be in the same document (though there are some cases, such as PrependIterator, where this is the responsibility of the user of the class and is not enforced.)
  • Method Details

    • moveNext

      boolean moveNext()
      Move to the next node, without returning it. Returns true if there is a next node, false if the end of the sequence has been reached. After calling this method, the current node may be retrieved using the current() function.
      Returns:
      true if there is a next node, false if the end of the sequence has been reached
    • next

      T next()
      Description copied from interface: UnfailingIterator
      Get the next item in the sequence.
      Specified by:
      next in interface SequenceIterator<T extends NodeInfo>
      Specified by:
      next in interface UnfailingIterator<T extends NodeInfo>
      Returns:
      the next Item. If there are no more nodes, return null.
    • current

      T current()
      Description copied from interface: UnfailingIterator
      Get the current item in the sequence.
      Specified by:
      current in interface SequenceIterator<T extends NodeInfo>
      Specified by:
      current in interface UnfailingIterator<T extends NodeInfo>
      Returns:
      the current item, that is, the item most recently returned by next()
    • getAnother

      AxisIterator<T> getAnother()
      Description copied from interface: UnfailingIterator
      Get another iterator over the same sequence of items, positioned at the start of the sequence. It must be possible to call this method at any time, whether none, some, or all of the items in the original iterator have been read. The method is non-destructive: it does not change the state of the original iterator.
      Specified by:
      getAnother in interface SequenceIterator<T extends NodeInfo>
      Specified by:
      getAnother in interface UnfailingIterator<T extends NodeInfo>
      Returns:
      a new iterator over the same sequence
    • iterateAxis

      AxisIterator iterateAxis(byte axis, NodeTest test)
      Return an iterator over an axis, starting at the current node.
      Parameters:
      axis - the axis to iterate over, using a constant such as Axis.CHILD
      test - a predicate to apply to the nodes before returning them.
      Returns:
      an iterator over an axis, starting at the current node
      Throws:
      NullPointerException - if there is no current node
    • atomize

      Value atomize() throws XPathException
      Return the atomized value of the current node.
      Returns:
      the atomized value.
      Throws:
      NullPointerException - if there is no current node
      XPathException - if the current node cannot be atomized, for example because it is an element node with element-only content.
    • getStringValue

      CharSequence getStringValue()
      Return the string value of the current node.
      Returns:
      the string value, as an instance of CharSequence.
      Throws:
      NullPointerException - if there is no current node