org.jaxen.function
Class SumFunction
java.lang.Object
org.jaxen.function.SumFunction
- Function
public class SumFunction
extends java.lang.Object
4.4 number sum(node-set)
The sum function returns the sum, for each node in the argument node-set,
of the result of converting the string-values of the node to a number.
- bob mcwhirter (bob @ werken.com)
Object | call(Context context, List args) - Returns the sum of its arguments.
|
static Double | evaluate(Object obj, Navigator nav) - Returns the sum of the items in a list.
|
SumFunction
public SumFunction()
Create a new SumFunction
object.
call
public Object call(Context context,
List args)
throws FunctionCallException
Returns the sum of its arguments.
- call in interface Function
context
- the context at the point in the
expression when the function is calledargs
- a list that contains exactly one item, also a List
- a
Double
containing the sum of the items in args.get(0)
evaluate
public static Double evaluate(Object obj,
Navigator nav)
throws FunctionCallException
Returns the sum of the items in a list.
If necessary, each item in the list is first converted to a Double
as if by the XPath number()
function.
obj
- a List
of numbers to be summednav
- ignored