01: package net.sf.saxon.sort;
02:
03: import net.sf.saxon.om.SequenceIterator;
04: import net.sf.saxon.trans.XPathException;
05: import net.sf.saxon.value.AtomicValue;
06:
07: /**
08: * A GroupIterator is an iterator that iterates over a sequence of groups.
09: * 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: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
39: // you may not use this file except in compliance with the License. You may obtain a copy of the
40: // License at http://www.mozilla.org/MPL/
41: //
42: // Software distributed under the License is distributed on an "AS IS" basis,
43: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
44: // See the License for the specific language governing rights and limitations under the License.
45: //
46: // The Original Code is: all this file.
47: //
48: // The Initial Developer of the Original Code is Michael H. Kay
49: //
50: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
51: //
52: // Contributor(s): none
53: //
|