net.sf.saxon.functions
Class Reverse

java.lang.Object
  extended by net.sf.saxon.expr.Expression
      extended by net.sf.saxon.expr.FunctionCall
          extended by net.sf.saxon.functions.SystemFunction
              extended by net.sf.saxon.functions.Reverse
All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, EvaluableItem, SequenceIterable, InstructionInfo, Locator

public class Reverse
extends SystemFunction

Implement XPath function fn:reverse()

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.functions.SystemFunction
operation
 
Fields inherited from class net.sf.saxon.expr.FunctionCall
argument
 
Fields inherited from class net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, staticProperties
 
Constructor Summary
Reverse()
           
 
Method Summary
 int computeSpecialProperties()
          Determine the special properties of this expression.
 boolean effectiveBooleanValue(XPathContext context)
          Get the effective boolean value of the expression.
 ItemType getItemType(TypeHierarchy th)
          Determine the item type of the value returned by the function
 SequenceIterator iterate(XPathContext context)
          Return an Iterator to iterate over the values of a sequence.
 
Methods inherited from class net.sf.saxon.functions.SystemFunction
addContextDocumentArgument, addDocToPathMap, checkArguments, computeCardinality, copy, getDetails, getErrorCodeForTypeErrors, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault
 
Methods inherited from class net.sf.saxon.expr.FunctionCall
addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheck
 
Methods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, evaluateAsString, evaluateItem, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Reverse

public Reverse()
Method Detail

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the item type of the value returned by the function

Overrides:
getItemType in class SystemFunction
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)

computeSpecialProperties

public int computeSpecialProperties()
Description copied from class: SystemFunction
Determine the special properties of this expression. The general rule is that a system function call is non-creative if its return type is atomic, or if all its arguments are non-creative. This is overridden for the generate-id() function, which is considered creative if its operand is creative (because the result depends on the identity of the operand)

Overrides:
computeSpecialProperties in class SystemFunction
Returns:
the special properties, as a bit-significant integer

iterate

public SequenceIterator iterate(XPathContext context)
                         throws XPathException
Description copied from class: Expression
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 interface SequenceIterable
Overrides:
iterate in class Expression
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

public boolean effectiveBooleanValue(XPathContext context)
                              throws XPathException
Description copied from class: Expression
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.

Overrides:
effectiveBooleanValue in class Expression
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


Copyright (c) Saxonica Limited. All rights reserved.