org.ucl.xpath.function
Class FnAvg

java.lang.Object
  extended byorg.ucl.xpath.function.Function
      extended byorg.ucl.xpath.function.FnAvg

public class FnAvg
extends Function

Returns the average of the values in the input sequence $arg, that is, the sum of the values divided by the number of values.


Field Summary
 
Fields inherited from class org.ucl.xpath.function.Function
_arity, _fl, _name
 
Constructor Summary
FnAvg()
          Constructor for FnAvg.
 
Method Summary
static ResultSequence avg(java.util.Collection args)
          Average value operation.
 ResultSequence evaluate(java.util.Collection args)
          Evaluate arguments.
static ResultSequence get_arg(java.util.Collection args)
          Obtain input argument for operation.
 
Methods inherited from class org.ucl.xpath.function.Function
arity, convert_argument, convert_arguments, dynamic_context, name, set_function_library, signature, signature, signature, static_context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FnAvg

public FnAvg()
Constructor for FnAvg.

Method Detail

evaluate

public ResultSequence evaluate(java.util.Collection args)
                        throws DynamicError
Evaluate arguments.

Specified by:
evaluate in class Function
Parameters:
args - argument expressions.
Returns:
Result of evaluation.
Throws:
DynamicError - Dynamic error.

avg

public static ResultSequence avg(java.util.Collection args)
                          throws DynamicError
Average value operation.

Parameters:
args - Result from the expressions evaluation.
Returns:
Result of fn:avg operation.
Throws:
DynamicError - Dynamic error.

get_arg

public static ResultSequence get_arg(java.util.Collection args)
                              throws DynamicError
Obtain input argument for operation.

Parameters:
args - input expressions.
Returns:
Resulting expression from the operation.
Throws:
DynamicError - Dynamic error.