Class Average

All Implemented Interfaces:
Callable, FunctionItem, GroundedValue, Item, Sequence

public class Average extends FoldingFunction
Implementation of the fn:avg function
  • Constructor Details

    • Average

      public Average()
  • Method Details

    • getCardinality

      public int getCardinality(Expression[] arguments)
      Determine the cardinality of the function.
      Overrides:
      getCardinality in class SystemFunction
      Parameters:
      arguments - the actual arguments supplied
      Returns:
      the most precise available cardinality that the function will return
    • getFold

      public Fold getFold(XPathContext context, Sequence... additionalArguments)
      Create the Fold object which actually performs the evaluation.
      Specified by:
      getFold in class FoldingFunction
      Parameters:
      context - the dynamic evaluation context
      additionalArguments - the values of all arguments other than the first.
      Returns:
      the Fold object used to compute the function