Package net.sf.saxon.sort
Class Reverser
java.lang.Object
net.sf.saxon.expr.ComputedExpression
net.sf.saxon.expr.UnaryExpression
net.sf.saxon.sort.Reverser
- All Implemented Interfaces:
Serializable
,SourceLocator
,Container
,Expression
,InstructionInfoProvider
A Reverser is an expression that reverses the order of a sequence of items.
- See Also:
-
Field Summary
Fields inherited from class net.sf.saxon.expr.UnaryExpression
operand
Fields inherited from class net.sf.saxon.expr.ComputedExpression
locationId, staticProperties
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the static properties of this expression (other than its type).protected String
displayOperator
(Configuration config) Give a string representation of the operator for use in diagnosticsboolean
effectiveBooleanValue
(XPathContext context) Get the effective boolean value of the expression.iterate
(XPathContext context) Return an Iterator to iterate over the values of a sequence.promote
(PromotionOffer offer) Promote this expression if possibleMethods inherited from class net.sf.saxon.expr.UnaryExpression
computeCardinality, display, equals, getBaseExpression, getItemType, hashCode, iterateSubExpressions, optimize, replaceSubExpression, simplify, typeCheck
Methods inherited from class net.sf.saxon.expr.ComputedExpression
adoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, evaluateAsString, evaluateItem, getCardinality, getColumnNumber, getConstructType, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getInstructionInfo, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, markTailFunctionCalls, process, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeError
-
Constructor Details
-
Reverser
-
-
Method Details
-
computeSpecialProperties
public int computeSpecialProperties()Description copied from class:UnaryExpression
Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.- Overrides:
computeSpecialProperties
in classUnaryExpression
-
promote
Promote this expression if possible- Specified by:
promote
in interfaceExpression
- Overrides:
promote
in classUnaryExpression
- 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- Returns:
- if the offer is not accepted, return this expression unchanged. Otherwise return the result of rewriting the expression to promote this subexpression
- Throws:
XPathException
- if any error is detected
-
iterate
Description copied from class:ComputedExpression
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.- Specified by:
iterate
in interfaceExpression
- Overrides:
iterate
in classComputedExpression
- Parameters:
context
- supplies the context for evaluation- Returns:
- a SequenceIterator that can be used to iterate over the result of the expression
- Throws:
XPathException
- if any dynamic error occurs evaluating the expression
-
effectiveBooleanValue
Description copied from class:ComputedExpression
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.- Specified by:
effectiveBooleanValue
in interfaceExpression
- Overrides:
effectiveBooleanValue
in classComputedExpression
- Parameters:
context
- The context in which the expression is to be evaluated- Returns:
- the effective boolean value
- Throws:
XPathException
- if any dynamic error occurs evaluating the expression
-
displayOperator
Give a string representation of the operator for use in diagnostics- Specified by:
displayOperator
in classUnaryExpression
- Parameters:
config
-- Returns:
- the operator, as a string
-