Package org.jaxen.function
Class CountFunction
- java.lang.Object
-
- org.jaxen.function.CountFunction
-
- All Implemented Interfaces:
Function
public class CountFunction extends java.lang.Object implements Function
4.1
number count(node-set)The count function returns the number of nodes in the argument node-set.
- Author:
- bob mcwhirter (bob @ werken.com)
- See Also:
- Section 4.1 of the XPath Specification
-
-
Constructor Summary
Constructors Constructor Description CountFunction()Create a newCountFunctionobject.
-
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 number of nodes in the specified node-set.static java.lang.Doubleevaluate(java.lang.Object obj)Returns the number of nodes in the specified node-set.
-
-
-
Method Detail
-
call
public java.lang.Object call(Context context, java.util.List args) throws FunctionCallException
Returns the number of nodes in the specified node-set.
- Specified by:
callin interfaceFunction- Parameters:
context- ignoredargs- the function arguments- Returns:
- a
Doublegiving the integral number of items in the first argument - Throws:
FunctionCallException- if args does not have exactly one item; or that item is not aList
-
evaluate
public static java.lang.Double evaluate(java.lang.Object obj) throws FunctionCallExceptionReturns the number of nodes in the specified node-set.
- Parameters:
obj- aListof nodes- Returns:
- the integral number of items in the list
- Throws:
FunctionCallException- if obj is not aList
-
-