net.sf.saxon.expr.sort

## Interface GroupIterator

- All Superinterfaces:
    SequenceIterator
  All Known Implementing Classes:
    GroupAdjacentIterator, GroupByIterator, GroupByIterator.ManualGroupByIterator, GroupEndingIterator, GroupMatchingIterator, GroupStartingIterator, ManualGroupIterator, MergeGroupingIterator, MergeGroupingIterator.ManualMergGroupingIterator, 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.

- - ### Field Summary

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

      `GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD`

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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
    `boolean` | `hasCurrentGroup()` Ask whether this iterator has a current group
    `boolean` | `hasCurrentGroupingKey()` Ask whether this iterator has a current grouping key
    `SequenceIterator<? extends Item>` | `iterateCurrentGroup()` Get an iterator over the members of the current group, in population order.
    `void` | `setGroupSlot(int groupSlot)` Set a local variable slot to hold the value of the current group
    `void` | `setKeySlot(int keySlot)` Set a local variable slot to hold the value of the current grouping key

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

      `close, current, getAnother, getProperties, next, position`

- - ### Method Detail

    - #### setGroupSlot

          void setGroupSlot(int groupSlot)

      Set a local variable slot to hold the value of the current group
      Parameters:
        `groupSlot` - the stack frame position of the variable holding the current group

    - #### setKeySlot

          void setKeySlot(int keySlot)

      Set a local variable slot to hold the value of the current grouping key
      Parameters:
        `keySlot` - the stack frame position of the variable holding the current grouping key

    - #### 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<? extends Item> 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

    - #### hasCurrentGroup

          boolean hasCurrentGroup()

      Ask whether this iterator has a current group
      Returns:
        false if the controlling xsl:for-each-group element binds a group variable, true if it delivers results using the current-group() function

    - #### hasCurrentGroupingKey

          boolean hasCurrentGroupingKey()

      Ask whether this iterator has a current grouping key
      Returns:
        false if the controlling xsl:for-each-group element binds a grouping-key variable, true if it delivers results using the current-grouping-key() function

    - #### getSnapShot

          ManualGroupIterator getSnapShot(XPathContext context)
                                          throws XPathException

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

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.