Package net.sf.saxon.tree.iter

## Interface LookaheadIterator

- All Superinterfaces:
    `java.lang.AutoCloseable`, `java.io.Closeable`, `SequenceIterator`
  All Known Subinterfaces:
    `ConstrainedIterator<T>`
  All Known Implementing Classes:
    `AdjacentTextNodeMergingIterator`, `ArrayIterator`, `ArrayIterator.OfNodes`, `AttributeIterator`, `BigRangeIterator`, `EmptyIterator`, `FocusTrackingIterator`, `GroupAdjacentIterator`, `GroupByIterator`, `GroupByIterator.ManualGroupByIterator`, `GroupEndingIterator`, `GroupMatchingIterator`, `GroupStartingIterator`, `ItemMappingIterator`, `ListIterator`, `ListIterator.Atomic`, `ListIterator.OfNodes`, `LookaheadIteratorImpl`, `ManualGroupIterator`, `ManualIterator`, `ManualRegexIterator`, `MergeGroupingIterator`, `MergeGroupingIterator.ManualMergeGroupingIterator`, `MergeIterator`, `MultiIndex.SelectedItemsIterator`, `MultithreadedFocusTrackingIterator`, `MultithreadedItemMappingIterator`, `NodeWrappingAxisIterator`, `OneToOneMappingIterator`, `RangeIterator`, `ReverseListIterator`, `ReverseRangeIterator`, `SingleAtomicIterator`, `SingleNodeIterator`, `SingletonIterator`, `SortedGroupIterator`, `SortedIterator`, `SubsequenceIterator`, `TailIterator`, `UnionEnumeration`, `UnionIterator`, `UntypedAtomizingIterator`, `ValueTailIterator`

      public interface LookaheadIterator
      extends SequenceIterator

  A SequenceIterator is used to iterate over a sequence. A LookaheadIterator is one that supports a hasNext() method to determine if there are more nodes after the current node.

- - ### Nested Class Summary

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

      `SequenceIterator.Property`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `hasNext()` | Determine whether there are more items to come.

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

      `close, forEachOrFail, getProperties, materialize, next`

- - ### Method Detail

    - #### hasNext

          boolean hasNext()

      Determine whether there are more items to come. Note that this operation is stateless and it is not necessary (or usual) to call it before calling next(). It is used only when there is an explicit need to tell if we are at the last element.

      This method must not be called unless the result of getProperties() on the iterator includes the property `SequenceIterator.Property.LOOKAHEAD`

      Returns:
        true if there are more items in the sequence