Class AggregateUtils
- Object
-
- org.thymeleaf.util.AggregateUtils
-
public final class AggregateUtils extends Object
- Since:
- 1.0
- Author:
- Daniel Fernández
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigDecimalavg(byte[] target)Returns the average of all the numbers contained in the provided array.static BigDecimalavg(double[] target)Returns the average of all the numbers contained in the provided array.static BigDecimalavg(float[] target)Returns the average of all the numbers contained in the provided array.static BigDecimalavg(int[] target)Returns the average of all the numbers contained in the provided array.static BigDecimalavg(long[] target)Returns the average of all the numbers contained in the provided array.static BigDecimalavg(short[] target)Returns the average of all the numbers contained in the provided array.static BigDecimalavg(Iterable<? extends Number> target)Returns the average of all the numbers contained in the provided iterable (e.g.static BigDecimalavg(Object[] target)Returns the average of all the numbers contained in the provided array.static BigDecimalsum(byte[] target)Returns the sum of all the numbers contained in the provided array.static BigDecimalsum(double[] target)Returns the sum of all the numbers contained in the provided array.static BigDecimalsum(float[] target)Returns the sum of all the numbers contained in the provided array.static BigDecimalsum(int[] target)Returns the sum of all the numbers contained in the provided array.static BigDecimalsum(long[] target)Returns the sum of all the numbers contained in the provided array.static BigDecimalsum(short[] target)Returns the sum of all the numbers contained in the provided array.static BigDecimalsum(Iterable<? extends Number> target)Returns the sum of all the numbers contained in the provided iterable (e.g.static BigDecimalsum(Object[] target)Returns the sum of all the numbers contained in the provided array.
-
-
-
Method Detail
-
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
-
-