Class AggregateUtils


  • public final class AggregateUtils
    extends 
    Since:
    1.0
    Author:
    Daniel Fernández
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static avg​(byte[] target)
      Returns the average of all the numbers contained in the provided array.
      static avg​(double[] target)
      Returns the average of all the numbers contained in the provided array.
      static avg​(float[] target)
      Returns the average of all the numbers contained in the provided array.
      static avg​(int[] target)
      Returns the average of all the numbers contained in the provided array.
      static avg​(long[] target)
      Returns the average of all the numbers contained in the provided array.
      static avg​(short[] target)
      Returns the average of all the numbers contained in the provided array.
      static <? extends > target)
      Returns the average of all the numbers contained in the provided iterable (e.g.
      static [] target)
      Returns the average of all the numbers contained in the provided array.
      static sum​(byte[] target)
      Returns the sum of all the numbers contained in the provided array.
      static sum​(double[] target)
      Returns the sum of all the numbers contained in the provided array.
      static sum​(float[] target)
      Returns the sum of all the numbers contained in the provided array.
      static sum​(int[] target)
      Returns the sum of all the numbers contained in the provided array.
      static sum​(long[] target)
      Returns the sum of all the numbers contained in the provided array.
      static sum​(short[] target)
      Returns the sum of all the numbers contained in the provided array.
      static <? extends > target)
      Returns the sum of all the numbers contained in the provided iterable (e.g.
      static [] target)
      Returns the sum of all the numbers contained in the provided array.
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Method Detail

      • sum

        public static  sum​(<? extends > target)

        Returns the sum of all the numbers contained in the provided iterable (e.g. a collection).

        Parameters:
        target - the iterable containing the number objects
        Returns:
        the sum, as a BigDecimal
      • sum

        public static  sum​([] target)

        Returns the sum of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the sum, as a BigDecimal
      • sum

        public static  sum​(byte[] target)

        Returns the sum of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the sum, as a BigDecimal
      • sum

        public static  sum​(short[] target)

        Returns the sum of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the sum, as a BigDecimal
      • sum

        public static  sum​(int[] target)

        Returns the sum of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the sum, as a BigDecimal
      • sum

        public static  sum​(long[] target)

        Returns the sum of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the sum, as a BigDecimal
      • sum

        public static  sum​(float[] target)

        Returns the sum of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the sum, as a BigDecimal
      • sum

        public static  sum​(double[] target)

        Returns the sum of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the sum, as a BigDecimal
      • avg

        public static  avg​(<? extends > target)

        Returns the average of all the numbers contained in the provided iterable (e.g. a collection).

        Parameters:
        target - the iterable containing the number objects
        Returns:
        the average, as a BigDecimal
      • avg

        public static  avg​([] target)

        Returns the average of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the average, as a BigDecimal
      • avg

        public static  avg​(byte[] target)

        Returns the average of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the average, as a BigDecimal
      • avg

        public static  avg​(short[] target)

        Returns the average of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the average, as a BigDecimal
      • avg

        public static  avg​(int[] target)

        Returns the average of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the average, as a BigDecimal
      • avg

        public static  avg​(long[] target)

        Returns the average of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the average, as a BigDecimal
      • avg

        public static  avg​(float[] target)

        Returns the average of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the average, as a BigDecimal
      • avg

        public static  avg​(double[] target)

        Returns the average of all the numbers contained in the provided array.

        Parameters:
        target - the array of numbers
        Returns:
        the average, as a BigDecimal