Package org.jaxen.function
Class PositionFunction
- java.lang.Object
-
- org.jaxen.function.PositionFunction
-
- All 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
Constructors Constructor Description PositionFunction()Create a newPositionFunctionobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectcall(Context context, java.util.List args)Returns the position of the context node in the context node-set.static java.lang.Doubleevaluate(Context context)Returns the position of the context node in the context node-set.
-
-
-
Method Detail
-
call
public java.lang.Object call(Context context, java.util.List args) throws FunctionCallException
Returns the position of the context node in the context node-set.- Specified by:
callin interfaceFunction- Parameters:
context- the context at the point in the expression where the function is calledargs- an empty list- Returns:
- a
Doublecontaining the context position - Throws:
FunctionCallException- ifargsis not empty- See Also:
Context.getSize()
-
evaluate
public static java.lang.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
Doublecontaining the context position - See Also:
Context.getPosition()
-
-