net.sf.saxon.sort
public class TupleSorter extends Expression
Nested Class Summary | |
---|---|
static class | TupleSorter.TupleUnwrapper
Mapping function to map the wrapped objects returned by the SortedTupleIterator
into real items. |
Constructor Summary | |
---|---|
TupleSorter(Expression base, SortKeyDefinition[] keys)
Create a TupleSorter |
Method Summary | |
---|---|
int | computeCardinality() |
Expression | copy()
Copy an expression. |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
Expression | getBaseExpression()
Get the base expression, the expression that computes the sequence to be sorted |
AtomicComparer[] | getComparators()
Get the array of AtomicComparer objects, one per sort key, that are used to compare values in the sequence |
ItemType | getItemType(TypeHierarchy th) |
SequenceIterator | iterate(XPathContext context) |
Iterator<Expression> | iterateSubExpressions() |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
Expression | promote(PromotionOffer offer, Expression parent)
Promote this expression if possible |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
Expression | simplify(ExpressionVisitor visitor) |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType) |
Parameters: base The base expression returns the sequence of tuples to be sorted. Each tuple is represented by an ObjectValue which wraps a Value (that is, in general, a sequence) keys Although this class uses the SortKeyDefinition class to define the sort keys, the actual sort key expression in the SortKeyDefinition is not used. This is because the sort key is instead computed as one of the members of the tuple delivered by the TupleSorter. Therefore, the sort key expression is not managed as a child of this expression. Moreover, in xquery the other aspects of a sort key are always fixed statically, so we don't treat those as subexpressions either.
Returns: the copy of the original expression
Returns: the base expression
Returns: an array of AtomicComparer objects, one per sort key
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found