Class AggregateUtils

java.lang.Object
org.thymeleaf.util.AggregateUtils

public final class AggregateUtils extends Object
Since:
1.0
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static BigDecimal
    avg(byte[] target)
    Returns the average of all the numbers contained in the provided array.
    static BigDecimal
    avg(double[] target)
    Returns the average of all the numbers contained in the provided array.
    static BigDecimal
    avg(float[] target)
    Returns the average of all the numbers contained in the provided array.
    static BigDecimal
    avg(int[] target)
    Returns the average of all the numbers contained in the provided array.
    static BigDecimal
    avg(long[] target)
    Returns the average of all the numbers contained in the provided array.
    static BigDecimal
    avg(short[] target)
    Returns the average of all the numbers contained in the provided array.
    static BigDecimal
    avg(Iterable<? extends Number> target)
    Returns the average of all the numbers contained in the provided iterable (e.g.
    static BigDecimal
    avg(Object[] target)
    Returns the average of all the numbers contained in the provided array.
    static BigDecimal
    sum(byte[] target)
    Returns the sum of all the numbers contained in the provided array.
    static BigDecimal
    sum(double[] target)
    Returns the sum of all the numbers contained in the provided array.
    static BigDecimal
    sum(float[] target)
    Returns the sum of all the numbers contained in the provided array.
    static BigDecimal
    sum(int[] target)
    Returns the sum of all the numbers contained in the provided array.
    static BigDecimal
    sum(long[] target)
    Returns the sum of all the numbers contained in the provided array.
    static BigDecimal
    sum(short[] target)
    Returns the sum of all the numbers contained in the provided array.
    static BigDecimal
    sum(Iterable<? extends Number> target)
    Returns the sum of all the numbers contained in the provided iterable (e.g.
    static BigDecimal
    sum(Object[] target)
    Returns the sum of all the numbers contained in the provided array.
    private static BigDecimal
    toBigDecimal(byte number)
     
    private static BigDecimal
    toBigDecimal(double number)
     
    private static BigDecimal
    toBigDecimal(float number)
     
    private static BigDecimal
    toBigDecimal(int number)
     
    private static BigDecimal
    toBigDecimal(long number)
     
    private static BigDecimal
    toBigDecimal(short number)
     
    private static BigDecimal
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AggregateUtils

      private AggregateUtils()
  • Method Details

    • sum

      public static BigDecimal sum(Iterable<? extends Number> 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 BigDecimal sum(Object[] 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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal avg(Iterable<? extends Number> 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 BigDecimal avg(Object[] 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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal 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
    • toBigDecimal

      private static BigDecimal toBigDecimal(Number number)
    • toBigDecimal

      private static BigDecimal toBigDecimal(byte number)
    • toBigDecimal

      private static BigDecimal toBigDecimal(short number)
    • toBigDecimal

      private static BigDecimal toBigDecimal(int number)
    • toBigDecimal

      private static BigDecimal toBigDecimal(long number)
    • toBigDecimal

      private static BigDecimal toBigDecimal(float number)
    • toBigDecimal

      private static BigDecimal toBigDecimal(double number)