Class SortedGroupIterator

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, LastPositionFinder, GroupIterator, SequenceIterator, LookaheadIterator

    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).
    • Method Detail

      • getCurrentGroupingKey

        public AtomicSequence getCurrentGroupingKey()
        Description copied from interface: GroupIterator
        Get the grouping key of the current group
        Specified by:
        getCurrentGroupingKey in interface GroupIterator
        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

        public GroundedValue currentGroup()
                                   throws XPathException
        Description copied from interface: GroupIterator
        Get a sequence containing the members of the current group, in population order. This may be a MemoSequence rather than a grounded value
        Specified by:
        currentGroup in interface GroupIterator
        Returns:
        a sequence containing all the members of the current group, in population order.
        Throws:
        XPathException - if a dynamic error occurs
      • getSnapShot

        public com.saxonica.ee.stream.ManualGroupIterator getSnapShot​(XPathContext context)
        Description copied from interface: GroupIterator
        Get a pseudo-iterator which represents a snapshot of this sequence at the current position
        Specified by:
        getSnapShot in interface GroupIterator
        Parameters:
        context - the XPath context
        Returns:
        the snapshot sequence