Class IncrementalIterator

java.lang.Object
net.sf.saxon.tree.iter.IncrementalIterator
All Implemented Interfaces:
Closeable, AutoCloseable, SequenceIterator

public class IncrementalIterator extends Object implements SequenceIterator
This class implements an AxisIterator by providing a start item, and a function that selects the next item as a function of the previous item.
  • Constructor Details

    • IncrementalIterator

      public IncrementalIterator(GNode start, Function<GNode,GNode> stepper)
      Create an IncrementalIterator
      Parameters:
      start - the first item to be returned by the iterator
      stepper - a function that computes the next item, given the current item, or returns null at the end of the sequence.
  • Method Details

    • next

      public GNode next()
      Get the next item in the sequence
      Specified by:
      next in interface SequenceIterator
      Returns:
      the next item, or null if there are no more items to be returned.