## Package net.sf.saxon.sort

This package provides utility routines for sorting and grouping.

See:
Description

Interface Summary
CollationURIResolver: A CollationURIResolver accepts a collation name as input, and returns a collation (represented by a Comparator) as output.
GroupIterator: A GroupIterator is an iterator that iterates over a sequence of groups.
IntIterator: An iterator over a sequence of unboxed int values
NodeOrderComparer: A Comparer used for comparing nodes in document order
Sortable: A Sortable is an object that can be sorted using the QuickSort method.

Class Summary
AtomicComparer: A Comparator used for comparing atomic values of arbitrary item types.
AtomicSortComparer: A Comparator used for comparing atomic values of arbitrary item types.
AtomicSortComparer.ComparisonKey: Inner class: an object used as a comparison key.
CodepointCollator: A collating sequence that uses Unicode codepoint ordering
DescendingComparer: A Comparer used for comparing descending keys
DocumentOrderIterator: DocumentOrderIterator takes as input an iteration of nodes in any order, and returns as output an iteration of the same nodes in document order, eliminating any duplicates.
DocumentSorter: A DocumentSorter is an expression that sorts a sequence of nodes into document order.
FixedSortKeyDefinition: A FixedSortKeyDefinition is a SortKeyDefinition in which all aspects of the sort key definition (sort order, data type, etc,) are known.
GenericSorter: Generically sorts arbitrary shaped data (for example multiple arrays, 1,2 or 3-d matrices, and so on) using a quicksort or mergesort.
GlobalOrderComparer: A Comparer used for comparing nodes in document order.
GroupAdjacentIterator: A GroupAdjacentIterator iterates over a sequence of groups defined by xsl:for-each-group group-adjacent="x".
GroupByIterator: A GroupByIterator iterates over a sequence of groups defined by xsl:for-each-group group-by="x".
GroupEndingIterator: A GroupEndingIterator iterates over a sequence of groups defined by xsl:for-each-group group-ending-with="x".
GroupStartingIterator: A GroupStartingIterator iterates over a sequence of groups defined by xsl:for-each-group group-starting-with="x".
IntHashMap: A hash table that maps int keys to Object values.
IntHashSet: Set of int values.
IntToIntHashMap: A hash table that maps int keys to int values.
LocalOrderComparer: A Comparer used for comparing nodes in document order.
LowercaseFirstComparer: A Comparer used for comparing keys
NumericComparer: A Comparer used for comparing sort keys when data-type="number".
QuickSort: This is a generic version of C.A.R Hoare's Quick Sort algorithm.
Reverser: A Reverser is an expression that reverses the order of a sequence of items.
SortedGroupIterator: A SortedGroupIterator is a modified SortedIterator.
SortedIterator: Class to do a sorted iteration
SortExpression: Expression equivalent to the imaginary syntax expr sortby (sort-key)+
SortKeyDefinition: A SortKeyDefinition defines one component of a sort key.
StandardCollationURIResolver: StandardCollationURIResolver allows a Collation to be created given a URI starting with "http://saxon.sf.net/collation?" followed by a set of query parameters.
TextComparer: A Comparer used for comparing sort keys when data-type="text".
TupleExpression: A tuple expression is an expression that returns a tuple.
TupleSorter: A TupleSorter is an expression that sorts a stream of tuples.
UppercaseFirstComparer: A Comparer used for comparing keys

## Package net.sf.saxon.sort Description

This package provides utility routines for sorting and grouping. Specifically, it contains a QuickSort implementation, and some Comparator objects that handle character and numeric comparisons, together with the important DocumentOrderIterator which iterates over a set of nodes in document order.

The package also contains the classes to support the implementation of the XSLT 2.0 instruction xsl:for-each-group, and some utilities for maintaining sets and maps whose keys are unboxed integer values.

Michael H. Kay
Saxonica Limited
22 September 2005