com.saxonica.stream

## Class ManualGroupIterator

- java.lang.Object
- - net.sf.saxon.tree.iter.ManualIterator
  - - com.saxonica.stream.ManualGroupIterator

- All Implemented Interfaces:
    LastPositionFinder, GroupIterator, SequenceIterator, GroundedIterator, LookaheadIterator, ReversibleIterator, UnfailingIterator
  Direct Known Subclasses:
    GroupByIterator.ManualGroupByIterator, MergeGroupingIterator.ManualMergGroupingIterator

      public abstract class ManualGroupIterator
      extends ManualIterator
      implements GroupIterator

  The class ManualGroupIterator represents an iterator that is never repositioned, but can be used to represent the focus in the dynamic context. It is used as a snapshot copy of a real grouping iterator for use when asynchronous threads are forked, as in xsl:result-document; the purpose of taking a snapshot is to ensure that changes to the base iterator in one thread do not affect the focus of another thread.

- - ### Field Summary

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

      `GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ManualGroupIterator(Item item, int position)` Create a manual grouping iterator

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
    `void` | `setGroupSlot(int groupSlot)` Set the slot number of the variable holding the current group
    `void` | `setKeySlot(int keySlot)` Set the slot number of the variable holding the current grouping key

    - ### Methods inherited from class net.sf.saxon.tree.iter.ManualIterator

      `close, current, getAnother, getLength, getProperties, getReverseIterator, hasNext, incrementPosition, materialize, next, position, setContextItem, setLastPositionFinder, setPosition`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface net.sf.saxon.expr.sort.GroupIterator

      `getCurrentGroupingKey, iterateCurrentGroup`

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

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

- - ### Constructor Detail

    - #### ManualGroupIterator

          public ManualGroupIterator(Item item,
                             int position)

      Create a manual grouping iterator
      Parameters:
        `item` - the context item
        `position` - the context position

  - ### Method Detail

    - #### setGroupSlot

          public void setGroupSlot(int groupSlot)

      Set the slot number of the variable holding the current group
      Specified by:
        `setGroupSlot` in interface `GroupIterator`
      Parameters:
        `groupSlot` - the stack frame position of the variable holding the current group

    - #### setKeySlot

          public void setKeySlot(int keySlot)

      Set the slot number of the variable holding the current grouping key
      Specified by:
        `setKeySlot` in interface `GroupIterator`
      Parameters:
        `keySlot` - the stack frame position of the variable holding the current grouping key

    - #### hasCurrentGroup

          public boolean hasCurrentGroup()

      Description copied from interface: `GroupIterator`
      Ask whether this iterator has a current group
      Specified by:
        `hasCurrentGroup` in interface `GroupIterator`
      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

          public boolean hasCurrentGroupingKey()

      Description copied from interface: `GroupIterator`
      Ask whether this iterator has a current grouping key
      Specified by:
        `hasCurrentGroupingKey` in interface `GroupIterator`
      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

          public ManualGroupIterator getSnapShot(XPathContext context)
                                          throws XPathException

      Description copied from interface: `GroupIterator`
      Get a sequence which is a snapshot of this sequence at the current position
      Specified by:
        `getSnapShot` in interface `GroupIterator`
      Throws:
        `XPathException`

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