net.sf.saxon.sort

Class TupleSorter

public class TupleSorter extends ComputedExpression implements MappingFunction

A TupleSorter is an expression that sorts a stream of tuples. It is used to implement XQuery FLWR expressions.
Constructor Summary
TupleSorter(Expression base, FixedSortKeyDefinition[] keys)
Method Summary
intcomputeCardinality()
voiddisplay(int level, NamePool pool, PrintStream out)
booleaneffectiveBooleanValue(XPathContext context)
ItemTypegetItemType(TypeHierarchy th)
SequenceIteratoriterate(XPathContext context)
IteratoriterateSubExpressions()
Objectmap(Item item, XPathContext context)
Mapping function to map the wrapped objects returned by the SortedTupleIterator into real items.
Expressionoptimize(Optimizer opt, StaticContext env, ItemType contextItemType)
Expressionpromote(PromotionOffer offer)
Promote this expression if possible
Expressionsimplify(StaticContext env)
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)

Constructor Detail

TupleSorter

public TupleSorter(Expression base, FixedSortKeyDefinition[] keys)

Method Detail

computeCardinality

public int computeCardinality()

display

public void display(int level, NamePool pool, PrintStream out)

effectiveBooleanValue

public boolean effectiveBooleanValue(XPathContext context)

getItemType

public ItemType getItemType(TypeHierarchy th)

iterate

public SequenceIterator iterate(XPathContext context)

iterateSubExpressions

public Iterator iterateSubExpressions()

map

public Object map(Item item, XPathContext context)
Mapping function to map the wrapped objects returned by the SortedTupleIterator into real items. This is done because each tuple may actually represent a sequence of underlying values that share the same sort key.

optimize

public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)

promote

public Expression promote(PromotionOffer offer)
Promote this expression if possible

simplify

public Expression simplify(StaticContext env)

typeCheck

public Expression typeCheck(StaticContext env, ItemType contextItemType)