Package net.sf.saxon.tree.iter

## Interface AxisIterator

- All Superinterfaces:
    `java.lang.AutoCloseable`, `java.io.Closeable`, `SequenceIterator`, `UnfailingIterator`
  All Known Implementing Classes:
    `AncestorIterator`, `ArrayIterator.OfNodes`, `AttributeIterator`, `AxiomDocument.FollowingSiblingIterator`, `AxiomDocument.PrecedingSiblingIterator`, `AxiomDocumentNodeWrapper.FollowingSiblingIterator`, `AxiomDocumentNodeWrapper.PrecedingSiblingIterator`, `AxiomParentNodeWrapper.ChildWrappingIterator`, `AxiomParentNodeWrapper.DescendantWrappingIterator`, `ConcatenatingAxisIterator`, `ListIterator.OfNodes`, `Navigator.AncestorEnumeration`, `Navigator.AxisFilter`, `Navigator.DescendantEnumeration`, `Navigator.EmptyTextFilter`, `Navigator.FollowingEnumeration`, `Navigator.PrecedingEnumeration`, `NodeWrappingAxisIterator`, `PrependAxisIterator`, `SingleNodeIterator`, `SteppingNavigator.DescendantAxisIterator`, `VirtualCopy.VirtualCopier`, `WrappingIterator`

      public interface AxisIterator
      extends UnfailingIterator

  A SequenceIterator is used to iterate over a sequence of items. 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.)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface net.sf.saxon.om.SequenceIterator

      `SequenceIterator.Property`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.util.Iterator<NodeInfo>` | `asIterator()` | Get a Java `Iterator` over the same nodes as this `AxisIterator`.
    `default void` | `forEachNode​(java.util.function.Consumer<? super NodeInfo> consumer)` |
    `NodeInfo` | `next()` | Get the next item in the sequence.

    - ### Methods inherited from interface net.sf.saxon.om.SequenceIterator

      `close, forEachOrFail, getProperties, materialize`

    - ### Methods inherited from interface net.sf.saxon.tree.iter.UnfailingIterator

      `forEach, toList`

- - ### Method Detail

    - #### next

          NodeInfo next()

      Description copied from interface: `UnfailingIterator`
      Get the next item in the sequence.
      Specified by:
        `next` in interface `SequenceIterator`
      Specified by:
        `next` in interface `UnfailingIterator`
      Returns:
        the next Item. If there are no more items, return null.

    - #### asIterator

          default java.util.Iterator<NodeInfo> asIterator()

      Get a Java `Iterator` over the same nodes as this `AxisIterator`. This is normally called when the iterator is positioned at the start; in principle, however, it can be called at any point in the iteration. The Java iterator picks up where the original `AxisIterator` left off
      Returns:
        a Java `Iterator` over the same nodes as this `AxisIterator`.

    - #### forEachNode

          default void forEachNode​(java.util.function.Consumer<? super NodeInfo> consumer)