1 package net.sf.saxon.sort; 2 3 import net.sf.saxon.om.SequenceIterator; 4 import net.sf.saxon.trans.XPathException; 5 import net.sf.saxon.value.AtomicValue; 6 7 /** 8 * A GroupIterator is an iterator that iterates over a sequence of groups. 9 * The normal methods such as next() and current() always deliver the leading item 10 * of the group. Additional methods are available to get the grouping key for the 11 * current group (only applicable to group-by and group-adjacent), and to get all the 12 * members of the current group. 13 */ 14 15 public interface GroupIterator extends SequenceIterator { 16 17 /** 18 * Get the grouping key of the current group 19 * @return the current grouping key in the case of group-by or group-adjacent, 20 * or null in the case of group-starting-with and group-ending-with 21 */ 22 23 public AtomicValue getCurrentGroupingKey(); 24 25 /** 26 * Get an iterator over the members of the current group, in population 27 * order. This must always be a clean iterator, that is, an iterator that 28 * starts at the first item of the group. 29 * @return an iterator over all the members of the current group, in population 30 * order. 31 */ 32 33 public SequenceIterator iterateCurrentGroup() throws XPathException; 34 35 } 36 37 38 // 39 // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); 40 // you may not use this file except in compliance with the License. You may obtain a copy of the 41 // License at http://www.mozilla.org/MPL/ 42 // 43 // Software distributed under the License is distributed on an "AS IS" basis, 44 // WITHOUT WARRANTY OF ANY KIND, either express or implied. 45 // See the License for the specific language governing rights and limitations under the License. 46 // 47 // The Original Code is: all this file. 48 // 49 // The Initial Developer of the Original Code is Michael H. Kay 50 // 51 // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved. 52 // 53 // Contributor(s): none 54 //