java.lang.Object
com.jayway.jsonpath.internal.function.numeric.AbstractAggregation
com.jayway.jsonpath.internal.function.numeric.Average
All Implemented Interfaces:
PathFunction

public class Average extends AbstractAggregation
Provides the average of a series of numbers in a JSONArray Created by mattg on 6/26/15.
  • Field Details

    • summation

      private Double summation
    • count

      private Double count
  • Constructor Details

    • Average

      public Average()
  • Method Details

    • next

      protected void next(Number value)
      Description copied from class: AbstractAggregation
      Defines the next value in the array to the mathmatical function
      Specified by:
      next in class AbstractAggregation
      Parameters:
      value - The numerical value to process next
    • getValue

      protected Number getValue()
      Description copied from class: AbstractAggregation
      Obtains the value generated via the series of next value calls
      Specified by:
      getValue in class AbstractAggregation
      Returns:
      A numerical answer based on the input value provided