Class Aggregates
- java.lang.Object
-
- org.thymeleaf.expression.Aggregates
-
public final class Aggregates extends java.lang.ObjectExpression Object for performing aggregation operations on numbers (collections or arrays) inside Thymeleaf Standard Expressions.
An object of this class is usually available in variable evaluation expressions with the name
#aggregates.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description Aggregates()Create an object of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalavg(byte[] target)Returns the average of all the numbers contained in the provided array.java.math.BigDecimalavg(double[] target)Returns the average of all the numbers contained in the provided array.java.math.BigDecimalavg(float[] target)Returns the average of all the numbers contained in the provided array.java.math.BigDecimalavg(int[] target)Returns the average of all the numbers contained in the provided array.java.math.BigDecimalavg(long[] target)Returns the average of all the numbers contained in the provided array.java.math.BigDecimalavg(short[] target)Returns the average of all the numbers contained in the provided array.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.java.math.BigDecimalavg(java.lang.Number[] target)Returns the average of all the numbers contained in the provided array.java.math.BigDecimalsum(byte[] target)Returns the sum of all the numbers contained in the provided array.java.math.BigDecimalsum(double[] target)Returns the sum of all the numbers contained in the provided array.java.math.BigDecimalsum(float[] target)Returns the sum of all the numbers contained in the provided array.java.math.BigDecimalsum(int[] target)Returns the sum of all the numbers contained in the provided array.java.math.BigDecimalsum(long[] target)Returns the sum of all the numbers contained in the provided array.java.math.BigDecimalsum(short[] target)Returns the sum of all the numbers contained in the provided array.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.java.math.BigDecimalsum(java.lang.Number[] target)Returns the sum of all the numbers contained in the provided array.
-
-
-
Method Detail
-
sum
public 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).
This method delegates on
AggregateUtils.sum(Iterable).- Parameters:
target- the iterable containing the number objects- Returns:
- the sum, as a BigDecimal
-
sum
public java.math.BigDecimal sum(java.lang.Number[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.sum(Object[]).- Parameters:
target- the array of numbers- Returns:
- the sum, as a BigDecimal
-
sum
public java.math.BigDecimal sum(byte[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.sum(byte[]).- Parameters:
target- the array of numbers- Returns:
- the sum, as a BigDecimal
-
sum
public java.math.BigDecimal sum(short[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.sum(short[]).- Parameters:
target- the array of numbers- Returns:
- the sum, as a BigDecimal
-
sum
public java.math.BigDecimal sum(int[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.sum(int[]).- Parameters:
target- the array of numbers- Returns:
- the sum, as a BigDecimal
-
sum
public java.math.BigDecimal sum(long[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.sum(long[]).- Parameters:
target- the array of numbers- Returns:
- the sum, as a BigDecimal
-
sum
public java.math.BigDecimal sum(float[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.sum(float[]).- Parameters:
target- the array of numbers- Returns:
- the sum, as a BigDecimal
-
sum
public java.math.BigDecimal sum(double[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.sum(double[]).- Parameters:
target- the array of numbers- Returns:
- the sum, as a BigDecimal
-
avg
public 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).
This method delegates on
AggregateUtils.avg(Iterable).- Parameters:
target- the iterable containing the number objects- Returns:
- the average, as a BigDecimal
-
avg
public java.math.BigDecimal avg(java.lang.Number[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.avg(Object[]).- Parameters:
target- the array of numbers- Returns:
- the average, as a BigDecimal
-
avg
public java.math.BigDecimal avg(byte[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.avg(byte[]).- Parameters:
target- the array of numbers- Returns:
- the average, as a BigDecimal
-
avg
public java.math.BigDecimal avg(short[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.avg(short[]).- Parameters:
target- the array of numbers- Returns:
- the average, as a BigDecimal
-
avg
public java.math.BigDecimal avg(int[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.avg(int[]).- Parameters:
target- the array of numbers- Returns:
- the average, as a BigDecimal
-
avg
public java.math.BigDecimal avg(long[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.avg(long[]).- Parameters:
target- the array of numbers- Returns:
- the average, as a BigDecimal
-
avg
public java.math.BigDecimal avg(float[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.avg(float[]).- Parameters:
target- the array of numbers- Returns:
- the average, as a BigDecimal
-
avg
public java.math.BigDecimal avg(double[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on
AggregateUtils.avg(double[]).- Parameters:
target- the array of numbers- Returns:
- the average, as a BigDecimal
-
-