Class Aggregates
Expression 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
- Author:
- Daniel Fernández
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionavg
(byte[] target) Returns the average of all the numbers contained in the provided array.avg
(double[] target) Returns the average of all the numbers contained in the provided array.avg
(float[] target) Returns the average of all the numbers contained in the provided array.avg
(int[] target) Returns the average of all the numbers contained in the provided array.avg
(long[] target) Returns the average of all the numbers contained in the provided array.avg
(short[] target) Returns the average of all the numbers contained in the provided array.Returns the average of all the numbers contained in the provided iterable (e.g.Returns the average of all the numbers contained in the provided array.sum
(byte[] target) Returns the sum of all the numbers contained in the provided array.sum
(double[] target) Returns the sum of all the numbers contained in the provided array.sum
(float[] target) Returns the sum of all the numbers contained in the provided array.sum
(int[] target) Returns the sum of all the numbers contained in the provided array.sum
(long[] target) Returns the sum of all the numbers contained in the provided array.sum
(short[] target) Returns the sum of all the numbers contained in the provided array.Returns the sum of all the numbers contained in the provided iterable (e.g.Returns the sum of all the numbers contained in the provided array.
-
Constructor Details
-
Aggregates
public Aggregates()Create an object of this class.
Normally, this is only executed internally by the expression evaluation subsystems in dialects.
-
-
Method Details
-
sum
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
-