net.sf.saxon.sort

Class SortedGroupIterator

Implemented Interfaces:
GroupIterator, LastPositionFinder, LookaheadIterator, SequenceIterator, Sortable

public class SortedGroupIterator
extends SortedIterator
implements GroupIterator

A SortedGroupIterator is a modified SortedIterator. It sorts a sequence of groups, and is itself a GroupIterator. The modifications retain extra information about the items being sorted. The items are each the leading item of a group, and as well as the item itself, the iterator preserves information about the group: specifically, an iterator over the items in the group, and the value of the grouping key (if any).

Field Summary

Fields inherited from class net.sf.saxon.sort.SortedIterator

base, comparators, context, count, nodeKeys, position, recordSize, sortKeyEvaluator

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

GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD

Constructor Summary

SortedGroupIterator(XPathContext context, GroupIterator base, SortKeyEvaluator sortKeyEvaluator, AtomicComparer[] comparators, InstructionInfoProvider origin)

Method Summary

protected void
buildArray()
Override the method that builds the array of values and sort keys.
AtomicValue
getCurrentGroupingKey()
SequenceIterator
iterateCurrentGroup()

Methods inherited from class net.sf.saxon.sort.SortedIterator

buildArray, compare, current, getAnother, getLastPosition, getProperties, hasNext, next, position, setHostLanguage, swap

Constructor Details

SortedGroupIterator

public SortedGroupIterator(XPathContext context,
                           GroupIterator base,
                           SortKeyEvaluator sortKeyEvaluator,
                           AtomicComparer[] comparators,
                           InstructionInfoProvider origin)

Method Details

buildArray

protected void buildArray()
            throws XPathException
Override the method that builds the array of values and sort keys.
Overrides:
buildArray in interface SortedIterator
Throws:
XPathException -

getCurrentGroupingKey

public AtomicValue getCurrentGroupingKey()
Specified by:
getCurrentGroupingKey in interface GroupIterator

iterateCurrentGroup

public SequenceIterator iterateCurrentGroup()
            throws XPathException
Specified by:
iterateCurrentGroup in interface GroupIterator