net.sf.saxon.sort
public class ConditionalSorter extends Expression
Constructor Summary | |
---|---|
ConditionalSorter(Expression condition, DocumentSorter sorter)
Create a conditional document sorter |
Method Summary | |
---|---|
protected int | computeCardinality()
Compute the static cardinality of this expression
|
protected int | computeSpecialProperties()
Compute the special properties of this expression. |
Expression | copy()
Copy an expression. |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
int | getCardinality()
Determine the static cardinality of the expression. |
Expression | getCondition()
Get the condition under which the nodes need to be sorted |
DocumentSorter | getDocumentSorter()
Get the document sorter, which sorts the nodes if the condition is true |
int | getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible. |
SequenceIterator | iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
Iterator<Expression> | iterateSubExpressions()
Get the immediate sub-expressions of this expression. |
Expression | promote(PromotionOffer offer, Expression parent)
Offer promotion for this subexpression. |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Perform type checking of an expression and its subexpressions. |
Parameters: condition the conditional expression sorter the sorting expression
Returns: the computed cardinality, as one of the values ALLOWS_ZERO_OR_ONE, EXACTLY_ONE, ALLOWS_ONE_OR_MORE, ALLOWS_ZERO_OR_MORE
Returns: the special properties, as a bit-significant integer
Returns: the copy of the original expression
Parameters: out the expression presenter used to display the structure
Returns: one of the values Cardinality.ONE_OR_MORE, Cardinality.ZERO_OR_MORE, Cardinality.EXACTLY_ONE, Cardinality.ZERO_OR_ONE, Cardinality.EMPTY. This default implementation returns ZERO_OR_MORE (which effectively gives no information).
Returns: the condition (an expression)
Returns: the document sorter
Returns: the implementation method, for example ConditionalSorter or ConditionalSorter or ConditionalSorter
This method should always return a result, though it may be the best approximation that is available at the time.
Parameters: th the type hierarchy cache
Returns: a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, or Type.ITEM (meaning not known at compile time)
Parameters: context supplies the context for evaluation
Returns: a SequenceIterator that can be used to iterate over the result of the expression
Throws: net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the expression
Returns: an iterator containing the sub-expressions of this expression
Parameters: offer details of the offer, for example the offer to move expressions that don't depend on the context to an outer level in the containing expression parent
Returns: if the offer is not accepted, return this expression unchanged. Otherwise return the result of rewriting the expression to promote this subexpression
Throws: net.sf.saxon.trans.XPathException if any error is detected
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found