## net.sf.saxon.expr.sort
Class GroupBySingletonIterator

    java.lang.Object
      net.sf.saxon.expr.sort.GroupByIterator
          net.sf.saxon.expr.sort.GroupBySingletonIterator

All Implemented Interfaces:
  LastPositionFinder, GroupIterator, SequenceIterator, LookaheadIterator

    public class GroupBySingletonIterator

extends GroupByIterator

A variant of the GroupByIterator used for XQuery 1.1 grouping, where the grouping key is either a single atomic value or an empty sequence, and an empty sequence compares equal to an empty sequence.

Field Summary

Fields inherited from class net.sf.saxon.expr.sort.GroupByIterator
`comparer, groupKeys, groups, keyExpression`

Fields inherited from interface net.sf.saxon.om.SequenceIterator
`GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD`

Constructor Summary
`GroupBySingletonIterator(SequenceIterator population, Expression keyExpression, XPathContext keyContext, StringCollator collator)` Create a GroupByIterator

Method Summary
`protected void` `processItem(HashMap<ComparisonKey,List<Item>> index, Item item, XPathContext c2)` Process one item in the population

Methods inherited from class net.sf.saxon.expr.sort.GroupByIterator
`close, current, getAnother, getCurrentGroup, getCurrentGroupingKey, getLastPosition, getProperties, hasNext, iterateCurrentGroup, next, position`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GroupBySingletonIterator

    public GroupBySingletonIterator(SequenceIterator population,
                                    Expression keyExpression,
                                    XPathContext keyContext,
                                    StringCollator collator)
                             throws XPathException

  Create a GroupByIterator

  Parameters:
    `population` - iterator over the population to be grouped
    `keyExpression` - the expression used to calculate the grouping key
    `keyContext` - dynamic context for calculating the grouping key
    `collator` - Collation to be used for comparing grouping keys
  Throws:
    `XPathException`

Method Detail

### processItem

    protected void processItem(HashMap<ComparisonKey,List<Item>> index,
                               Item item,
                               XPathContext c2)
                        throws XPathException

  Process one item in the population

  Overrides:
    `processItem` in class `GroupByIterator`
  Parameters:
    `index` - the index of items
    `item` - the item from the population to be processed
    `c2` - the XPath evaluation context
  Throws:
    `XPathException`

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