Package net.sf.saxon.expr.sort


package net.sf.saxon.expr.sort

This package provides utility routines for sorting and grouping. Specifically, it contains a QuickSort implementation, and some AtomicComparer 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.

  • Class
    Description
    A Comparer that treats strings as an alternating sequence of alpha parts and numeric parts.
    Interface representing an object that can be used to compare two XPath atomic values for equality or for ordering.
    Marker interface to identify an object that acts as a surrogate for an atomic value, with the property that if two atomic values are equal under the XPath 'eq' operator, then their corresponding surrogates are equal under the Java equals() comparison (and by implication, they have equal hash codes).
    An AtomicComparer used for comparing atomic values of arbitrary item types.
    A comparer specifically for comparing two date, time, or dateTime values
    A StringCollator that sorts lowercase before uppercase, or vice versa.
    An AtomicComparer used for comparing strings, untypedAtomic values, and URIs using the Unicode codepoint collation.
    A collating sequence that uses Unicode codepoint ordering
    An AtomicComparer used for comparing strings, untypedAtomic values, and URIs using a collation.
    A match key for comparing strings under a collation.
    A ComparisonException is a ClassCastException that encapsulates an XPathException.
    A composite atomic key is a sequence of atomic values; two such keys are matched be comparing the constituent values pairwise.
    An expression that sorts an underlying sequence into document order if some condition is true, or that returns the sequence "as is" (knowing that it doesn't need sorting) if the condition is false.
    Elaborator for a conditional sorter, which sorts the results of a subexpression into document order only if a supplied condition is true
    A comparer for comparing two "ordinary" atomic values, where the values implement the Comparable interface and the equals() method with the appropriate XPath semantics.
    A map implementation using a custom equality matcher, to avoid having to wrap each entry in a wrapper object to achieve customised equality testing.
    A mutable set implementation using a custom equality matcher, to avoid having to wrap each entry in a wrapper object to achieve customised equality testing.
    An AtomicComparer used for sorting values that are known to be instances of xs:decimal (including xs:integer), It also supports a separate method for getting a collation key to test equality of items
    A Comparer used for comparing descending keys.
    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.
    A DocumentSorter is an expression that sorts a sequence of nodes into document order.
    Elaborator for a docOrder expression - sorts nodes into document order and eliminates duplicates
    An AtomicComparer used for sorting values that are known to be numeric.
    A Comparer that modifies a base comparer by sorting empty key values and NaN values last (greatest), as opposed to the default which sorts them first.
    An iterator over a zero-length sequence of integers
    A comparer for comparing two atomic values where (a) equals is defined, and is implemented using the Java equals() method, and (b) ordering is not defined, and results in a dynamic error.
    Interface representing objects used to perform equality matching.
    An AtomicComparer used for comparing atomic values of arbitrary item types.
    An AtomicComparisonFunction compares two atomic values to return a result of true or false.
    A Comparer used for comparing nodes in document order.
    A GroupAdjacentIterator iterates over a sequence of groups defined by xsl:for-each-group group-adjacent="x".
    A GroupBreakingIterator iterates over a sequence of groups defined by xsl:for-each-group break-when="x".
    A GroupByIterator iterates over a sequence of groups defined by xsl:for-each-group group-by="x".
    A GroupEndingIterator iterates over a sequence of groups defined by xsl:for-each-group group-ending-with="x".
    A GroupIterator is an iterator that iterates over a sequence of groups.
    A GroupMatchingIterator contains code shared between GroupStartingIterator and GroupEndingIterator
    A GroupStartingIterator iterates over a sequence of groups defined by xsl:for-each-group group-starting-with="x".
    This class is a specialization of ObjectToBeSorted for use when the sequence being sorted is a sequence of groups.
    A collating sequence that compares strings according to the HTML5 rules for case-blind matching.
    A class representing an item together with its merge keys and the name of the merge source object from which it derived, suitable for encapsulation as an ObjectValue.
    A "Least Frequently Used" cache.
    A Comparer used for comparing nodes in document order.
    An iterator that groups the result of merging several xsl:merge input streams, identifying groups of adjacent items having the same merge key value
     
    Mapping function for items encountered during the merge; the mapping function wraps the merged item and its merge keys into a single composite object
    Inner class representing one merge source
    An iterator representing the sorted merge of two merge inputs, retaining all duplicates.
    A Comparer used for comparing sort keys when data-type="number".
    A Comparer used for comparing sort keys when data-type="number".
    This class represents a member of a sequence that is being sorted.
    This class wraps a RuleBasedCollator to provide a SubstringMatcher.
    A simple collation that just wraps a supplied Comparator
    This class implements equality and ordering comparisons between values of simple types: that is, atomic values, and sequences of atomic values, following the XSD-defined rules for equality and ordering comparisons.
    This class implements equality and identity comparisons between values of simple types: that is, atomic values, and sequences of atomic values, following the XSD-defined rules for equality and identity comparisons.
    A SortedGroupIterator is a modified SortedIterator.
    Class to do a sorted iteration
    Expression equivalent to the imaginary syntax expr sortby (sort-key)+
    Elaborator for a sort expression - sorts nodes into order based on a user-supplied sort key
    A SortKeyDefinition defines one component of a sort key.
    The class represents a list of sort key definitions in major-to-minor sort key order.
    Callback interface used to evaluate sort keys.
    A Comparer used for comparing sort keys when data-type="text".
    This class implements (an approximation to) the UCA Collation Algorithm relying solely on the built-in Java support (that is, without using the ICU library).
    A specialist comparer that implements the rules for comparing an untypedAtomic value (always the first operand) to a numeric value (always the second operand)
    This interface sometimes represents an XPath atomic value where the Java comparison semantics (using the compareTo method) match the XPath equality and ordering semantics; and sometimes it represents a surrogate for an XPath atomic value, chosen so that the Java comparison semantics match the XPath rules.