Class AggregateUtils
- java.lang.Object
-
- org.thymeleaf.util.AggregateUtils
-
public final class AggregateUtils extends java.lang.Object- Since:
- 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description privateAggregateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.math.BigDecimalavg(byte[] target)Returns the average of all the numbers contained in the provided array.static java.math.BigDecimalavg(double[] target)Returns the average of all the numbers contained in the provided array.static java.math.BigDecimalavg(float[] target)Returns the average of all the numbers contained in the provided array.static java.math.BigDecimalavg(int[] target)Returns the average of all the numbers contained in the provided array.static java.math.BigDecimalavg(long[] target)Returns the average of all the numbers contained in the provided array.static java.math.BigDecimalavg(short[] target)Returns the average of all the numbers contained in the provided array.static java.math.BigDecimalavg(java.lang.Iterable<? extends java.lang.Number> target)Returns the average of all the numbers contained in the provided iterable (e.g.static java.math.BigDecimalavg(java.lang.Object[] target)Returns the average of all the numbers contained in the provided array.static java.math.BigDecimalsum(byte[] target)Returns the sum of all the numbers contained in the provided array.static java.math.BigDecimalsum(double[] target)Returns the sum of all the numbers contained in the provided array.static java.math.BigDecimalsum(float[] target)Returns the sum of all the numbers contained in the provided array.static java.math.BigDecimalsum(int[] target)Returns the sum of all the numbers contained in the provided array.static java.math.BigDecimalsum(long[] target)Returns the sum of all the numbers contained in the provided array.static java.math.BigDecimalsum(short[] target)Returns the sum of all the numbers contained in the provided array.static java.math.BigDecimalsum(java.lang.Iterable<? extends java.lang.Number> target)Returns the sum of all the numbers contained in the provided iterable (e.g.static java.math.BigDecimalsum(java.lang.Object[] target)Returns the sum of all the numbers contained in the provided array.private static java.math.BigDecimaltoBigDecimal(byte number)private static java.math.BigDecimaltoBigDecimal(double number)private static java.math.BigDecimaltoBigDecimal(float number)private static java.math.BigDecimaltoBigDecimal(int number)private static java.math.BigDecimaltoBigDecimal(long number)private static java.math.BigDecimaltoBigDecimal(short number)private static java.math.BigDecimaltoBigDecimal(java.lang.Number number)
-
-
-
Method Detail
-
sum
public static java.math.BigDecimal sum(java.lang.Iterable<? extends java.lang.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 java.math.BigDecimal sum(java.lang.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 java.math.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 java.math.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 java.math.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 java.math.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 java.math.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 java.math.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 java.math.BigDecimal avg(java.lang.Iterable<? extends java.lang.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 java.math.BigDecimal avg(java.lang.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 java.math.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 java.math.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 java.math.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 java.math.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 java.math.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 java.math.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 java.math.BigDecimal toBigDecimal(java.lang.Number number)
-
toBigDecimal
private static java.math.BigDecimal toBigDecimal(byte number)
-
toBigDecimal
private static java.math.BigDecimal toBigDecimal(short number)
-
toBigDecimal
private static java.math.BigDecimal toBigDecimal(int number)
-
toBigDecimal
private static java.math.BigDecimal toBigDecimal(long number)
-
toBigDecimal
private static java.math.BigDecimal toBigDecimal(float number)
-
toBigDecimal
private static java.math.BigDecimal toBigDecimal(double number)
-
-