Package net.sf.saxon.expr.sort

## Interface GroupIterator

- All Superinterfaces:
    `java.lang.AutoCloseable`, `java.io.Closeable`, `SequenceIterator`
  All Known Implementing Classes:
    `GroupAdjacentIterator`, `GroupByIterator`, `GroupByIterator.ManualGroupByIterator`, `GroupEndingIterator`, `GroupMatchingIterator`, `GroupStartingIterator`, `ManualGroupIterator`, `MergeGroupingIterator`, `MergeGroupingIterator.ManualMergeGroupingIterator`, `SortedGroupIterator`

      public interface GroupIterator
      extends SequenceIterator

  A GroupIterator is an iterator that iterates over a sequence of groups. The normal methods such as next() and current() always deliver the leading item of the group. Additional methods are available to get the grouping key for the current group (only applicable to group-by and group-adjacent), and to get all the members of the current group.

- - ### 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
    --- | --- | ---
    `AtomicSequence` | `getCurrentGroupingKey()` | Get the grouping key of the current group
    `ManualGroupIterator` | `getSnapShot​(XPathContext context)` | Get a sequence which is a snapshot of this sequence at the current position
    `SequenceIterator` | `iterateCurrentGroup()` | Get an iterator over the members of the current group, in population order.

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

      `close, forEachOrFail, getProperties, materialize, next`

- - ### Method Detail

    - #### getCurrentGroupingKey

          AtomicSequence getCurrentGroupingKey()

      Get the grouping key of the current group
      Returns:
        the current grouping key in the case of group-by or group-adjacent, or null in the case of group-starting-with and group-ending-with

    - #### iterateCurrentGroup

          SequenceIterator iterateCurrentGroup()
                                        throws XPathException

      Get an iterator over the members of the current group, in population order. This must always be a clean iterator, that is, an iterator that starts at the first item of the group.
      Returns:
        an iterator over all the members of the current group, in population order.
      Throws:
        `XPathException` - if a dynamic error occurs

    - #### getSnapShot

          ManualGroupIterator getSnapShot​(XPathContext context)
                                   throws XPathException

      Get a sequence which is a snapshot of this sequence at the current position
      Throws:
        `XPathException`