Package net.sf.saxon.sort
Class SortedGroupIterator
java.lang.Object
net.sf.saxon.sort.SortedIterator
net.sf.saxon.sort.SortedGroupIterator
- All Implemented Interfaces:
LastPositionFinder
,SequenceIterator
,GroupIterator
,Sortable
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, index, nodeKeys, recordSize, sortkeys
Fields inherited from interface net.sf.saxon.om.SequenceIterator
ATOMIZABLE, GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD
-
Constructor Summary
ConstructorsConstructorDescriptionSortedGroupIterator
(XPathContext context, GroupIterator base, SortKeyDefinition[] sortKeys, Comparator[] comparators, InstructionInfoProvider origin) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Override the method that builds the array of values and sort keys.Get the grouping key of the current groupGet an iterator over the members of the current group, in population order.Methods inherited from class net.sf.saxon.sort.SortedIterator
compare, current, getAnother, getLastPosition, getProperties, next, position, setHostLanguage, swap
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.om.SequenceIterator
current, getAnother, getProperties, next, position
-
Constructor Details
-
SortedGroupIterator
public SortedGroupIterator(XPathContext context, GroupIterator base, SortKeyDefinition[] sortKeys, Comparator[] comparators, InstructionInfoProvider origin)
-
-
Method Details
-
buildArray
Override the method that builds the array of values and sort keys.- Overrides:
buildArray
in classSortedIterator
- Throws:
XPathException
-
getCurrentGroupingKey
Description copied from interface:GroupIterator
Get the grouping key of the current group- Specified by:
getCurrentGroupingKey
in interfaceGroupIterator
- 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
Description copied from interface:GroupIterator
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.- Specified by:
iterateCurrentGroup
in interfaceGroupIterator
- Returns:
- an iterator over all the members of the current group, in population order.
- Throws:
XPathException
-