org.inria.ns.reflex.processor.xcl
Class ReverseFunction

java.lang.Object
  extended by org.inria.ns.reflex.xml.xpath.XPathFunction.NamedXPathFunction
      extended by org.inria.ns.reflex.processor.xcl.ReverseFunction
All Implemented Interfaces:
DeferrableFunction, XPathFunction

public class ReverseFunction
extends XPathFunction.NamedXPathFunction
implements XPathFunction, DeferrableFunction

The xcl:reverse() function reverse the order of a list, or reverse the order of a sorting criterion.

This function reverse a sorting criterion when it is used inside the xcl:sort() function after the first argument. Out of the context of the xcl:sort() function, this function reverse the order of a list.

Author:
Philippe Poulard
See Also:
ReversedResult, SortFunction

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.xml.xpath.XPathFunction
XPathFunction.NamedXPathFunction
 
Constructor Summary
ReverseFunction()
           
 
Method Summary
 Object evaluate(XPathContext context, List args)
          Reverse the items of a list or reverse a sorting criterion.
 boolean isDeferred(int argument)
          The parameter of this function is deferred.
 
Methods inherited from class org.inria.ns.reflex.xml.xpath.XPathFunction.NamedXPathFunction
getQName, setQName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.inria.ns.reflex.xml.xpath.XPathFunction
getQName
 

Constructor Detail

ReverseFunction

public ReverseFunction()
Method Detail

evaluate

public Object evaluate(XPathContext context,
                       List args)
                throws XPathFunctionException
Reverse the items of a list or reverse a sorting criterion.

Specified by:
evaluate in interface XPathFunction
Parameters:
context - The context when evaluating this function : XPath variables, current node, etc.
args - The list of arguments passed to this function.
Returns:
The result of the evaluation.
Throws:
XPathFunctionException - When this function fails to be evaluated.
See Also:
XPathFunction.evaluate(org.inria.ns.reflex.xml.xpath.XPathContext, java.util.List)

isDeferred

public boolean isDeferred(int argument)
The parameter of this function is deferred.

Specified by:
isDeferred in interface DeferrableFunction
Parameters:
argument - 0.
Returns:
true.
See Also:
DeferrableFunction.isDeferred(int)