net.sf.saxon.sort
Class TupleSorter
- EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator
A TupleSorter is an expression that sorts a stream of tuples. It is used
to implement XQuery FLWR expressions.
static class | TupleSorter.TupleUnwrapper - Mapping function to map the wrapped objects returned by the SortedTupleIterator
into real items.
|
addToPathMap , adoptChildExpression , checkPermittedContents , computeCardinality , computeDependencies , computeSpecialProperties , computeStaticProperties , copy , display , doPromotion , dynamicError , effectiveBooleanValue , evaluateAsString , evaluateItem , explain , explain , findParentOf , getCardinality , getColumnNumber , getConstructType , getContainer , getDependencies , getExecutable , getHostLanguage , getImplementationMethod , getInstructionInfo , getIntrinsicDependencies , getItemType , getLineNumber , getLocationId , getLocationProvider , getPublicId , getSlotsUsed , getSpecialProperties , getSystemId , hasLoopingSubexpression , implementsStaticTypeCheck , iterate , iterateEvents , iterateSubExpressions , markTailFunctionCalls , optimize , process , promote , replaceSubExpression , resetLocalStaticProperties , setContainer , setFiltered , setFlattened , setLocationId , simplify , staticTypeCheck , suppressValidation , toString , typeCheck , typeError |
TupleSorter
public TupleSorter(Expression base,
SortKeyDefinition[] keys)
Create a TupleSorter
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.
copy
public Expression copy()
Copy an expression. This makes a deep copy.
- copy in interface Expression
- the copy of the original expression
explain
public void explain(ExpressionPresenter out)
Diagnostic print of expression structure. The abstract expression tree
is written to the supplied output destination.
- explain in interface Expression
getBaseExpression
public Expression getBaseExpression()
Get the base expression, the expression that computes the sequence to be sorted
getComparators
public AtomicComparer[] getComparators()
Get the array of AtomicComparer objects, one per sort key, that are used to compare values in the sequence
- an array of AtomicComparer objects, one per sort key
replaceSubExpression
public boolean replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression
- replaceSubExpression in interface Expression
original
- the original subexpressionreplacement
- the replacement subexpression
- true if the original subexpression is found