net.sf.saxon.sort
Class DocumentSorter
- EvaluableItem, InstructionInfoProvider, SequenceIterable, Serializable, SourceLocator
public class DocumentSorter
A DocumentSorter is an expression that sorts a sequence of nodes into
document order.
computeCardinality , computeSpecialProperties , displayExpressionName , displayOperator , equals , explain , getBaseExpression , getItemType , hashCode , iterateSubExpressions , optimize , promote , replaceSubExpression , simplify , toString , typeCheck |
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 |
DocumentSorter
public DocumentSorter(Expression base)
computeSpecialProperties
public int computeSpecialProperties()
Compute the special properties of this expression. These properties are denoted by a bit-significant
integer, possible values are in class
StaticProperty
. The "special" properties are properties
other than cardinality and dependencies, and most of them relate to properties of node sequences, for
example whether the nodes are in document order.
- computeSpecialProperties in interface UnaryExpression
- the special properties, as a bit-significant integer
copy
public Expression copy()
Copy an expression. This makes a deep copy.
- copy in interface Expression
- the copy of the original expression
effectiveBooleanValue
public boolean effectiveBooleanValue(XPathContext context)
throws XPathException
Get the effective boolean value of the expression. This returns false if the value
is the empty sequence, a zero-length string, a number equal to zero, or the boolean
false. Otherwise it returns true.
- effectiveBooleanValue in interface Expression
context
- The context in which the expression is to be evaluated
- the effective boolean value
XPathException
- if any dynamic error occurs evaluating the
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 UnaryExpression
iterate
public SequenceIterator iterate(XPathContext context)
throws XPathException
Return an Iterator to iterate over the values of a sequence. The value of every
expression can be regarded as a sequence, so this method is supported for all
expressions. This default implementation handles iteration for expressions that
return singleton values: for non-singleton expressions, the subclass must
provide its own implementation.
- iterate in interface SequenceIterable
- iterate in interface Expression
context
- supplies the context for evaluation
- a SequenceIterator that can be used to iterate over the result
of the expression
XPathException
- if any dynamic error occurs evaluating the
expression
optimize
public Expression optimize(ExpressionVisitor visitor,
ItemType contextItemType)
throws XPathException
Perform optimisation of an expression and its subexpressions. This is the third and final
phase of static optimization.
This method is called after all references to functions and variables have been resolved
to the declaration of the function or variable, and after all type checking has been done.
- optimize in interface UnaryExpression
visitor
- an expression visitorcontextItemType
- the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
- the original expression, rewritten if appropriate to optimize execution
XPathException
- if an error is discovered during this phase
(typically a type error)
simplify
public Expression simplify(ExpressionVisitor visitor)
throws XPathException
Simplify an expression. This performs any static optimization (by rewriting the expression
as a different expression). The default implementation does nothing.
- simplify in interface UnaryExpression
visitor
- an expression visitor
- the simplified expression
XPathException
- if an error is discovered during expression
rewriting