org.jaxen.function

Class PositionFunction

Implemented Interfaces:
Function

public class PositionFunction
extends java.lang.Object
implements Function

4.1 number position()
The position function returns a number equal to the context position from the expression evaluation context.
Author:
bob mcwhirter (bob @ werken.com)
See Also:
Section 4.1 of the XPath Specification

Constructor Summary

PositionFunction()
Create a new PositionFunction object.

Method Summary

Object
call(Context context, List args)
Returns the position of the context node in the context node-set.
static Double
evaluate(Context context)
Returns the position of the context node in the context node-set.

Constructor Details

PositionFunction

public PositionFunction()
Create a new PositionFunction object.

Method Details

call

public Object call(Context context,
                   List args)
            throws FunctionCallException
Returns the position of the context node in the context node-set.
Specified by:
call in interface Function
Parameters:
context - the context at the point in the expression where the function is called
args - an empty list
Returns:
a Double containing the context position
Throws:
FunctionCallException - if args is not empty

evaluate

public static Double evaluate(Context context)
Returns the position of the context node in the context node-set.
Parameters:
context - the context at the point in the expression where the function is called
Returns:
a Double containing the context position