Package net.sf.saxon.expr.sort
Class SortedGroupIterator
java.lang.Object
net.sf.saxon.expr.sort.SortedIterator
net.sf.saxon.expr.sort.SortedGroupIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,LastPositionFinder,GroupIterator,SequenceIterator,LookaheadIterator
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.expr.sort.SortedIterator
comparators, context, count, position, sortKeyEvaluator, values -
Constructor Summary
ConstructorsConstructorDescriptionSortedGroupIterator(XPathContext context, GroupIterator base, SortKeyEvaluator sortKeyEvaluator, AtomicComparer[] comparators) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidOverride the method that builds the array of values and sort keys.Get a sequence containing the members of the current group, in population order.Get the grouping key of the current groupgetSnapShot(XPathContext context) Get a pseudo-iterator which represents a snapshot of this sequence at the current positionMethods inherited from class net.sf.saxon.expr.sort.SortedIterator
getBaseIterator, getLength, hasNext, next, setHostLanguage, supportsGetLength, supportsHasNextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.om.SequenceIterator
close, next
-
Constructor Details
-
SortedGroupIterator
public SortedGroupIterator(XPathContext context, GroupIterator base, SortKeyEvaluator sortKeyEvaluator, AtomicComparer[] comparators)
-
-
Method Details
-
buildArray
Override the method that builds the array of values and sort keys.- Overrides:
buildArrayin classSortedIterator- Throws:
XPathException- in the event of a dynamic error
-
getCurrentGroupingKey
Description copied from interface:GroupIteratorGet the grouping key of the current group- Specified by:
getCurrentGroupingKeyin 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
-
currentGroup
Description copied from interface:GroupIteratorGet a sequence containing the members of the current group, in population order. This may be a MemoSequence rather than a grounded value- Specified by:
currentGroupin interfaceGroupIterator- Returns:
- a sequence containing all the members of the current group, in population order.
- Throws:
XPathException- if a dynamic error occurs
-
getSnapShot
Description copied from interface:GroupIteratorGet a pseudo-iterator which represents a snapshot of this sequence at the current position- Specified by:
getSnapShotin interfaceGroupIterator- Parameters:
context- the XPath context- Returns:
- the snapshot sequence
-