public final class Aggregates extends Object
Utility class for performing aggregation operations on numbers (collections or arrays).
An object of this class is usually available in variable evaluation expressions with the name #aggregates.
Constructor and Description |
---|
Aggregates()
Create an object of this class.
|
Modifier and Type | Method and Description |
---|---|
BigDecimal |
avg(byte[] target)
Returns the average of all the numbers contained in the provided array.
|
BigDecimal |
avg(double[] target)
Returns the average of all the numbers contained in the provided array.
|
BigDecimal |
avg(float[] target)
Returns the average of all the numbers contained in the provided array.
|
BigDecimal |
avg(int[] target)
Returns the average of all the numbers contained in the provided array.
|
BigDecimal |
avg(Iterable<? extends Number> target)
Returns the average of all the numbers contained in the provided
iterable (e.g.
|
BigDecimal |
avg(long[] target)
Returns the average of all the numbers contained in the provided array.
|
BigDecimal |
avg(Number[] target)
Returns the average of all the numbers contained in the provided array.
|
BigDecimal |
avg(short[] target)
Returns the average of all the numbers contained in the provided array.
|
BigDecimal |
sum(byte[] target)
Returns the sum of all the numbers contained in the provided array.
|
BigDecimal |
sum(double[] target)
Returns the sum of all the numbers contained in the provided array.
|
BigDecimal |
sum(float[] target)
Returns the sum of all the numbers contained in the provided array.
|
BigDecimal |
sum(int[] target)
Returns the sum of all the numbers contained in the provided array.
|
BigDecimal |
sum(Iterable<? extends Number> target)
Returns the sum of all the numbers contained in the provided
iterable (e.g.
|
BigDecimal |
sum(long[] target)
Returns the sum of all the numbers contained in the provided array.
|
BigDecimal |
sum(Number[] target)
Returns the sum of all the numbers contained in the provided array.
|
BigDecimal |
sum(short[] target)
Returns the sum of all the numbers contained in the provided array.
|
public Aggregates()
Create an object of this class.
Normally, this is only executed internally by the expression evaluation subsystems in dialects.
public BigDecimal sum(Iterable<? extends 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)
.
target
- the iterable containing the number objectspublic BigDecimal sum(Number[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on AggregateUtils.sum(Object[])
.
target
- the array of numberspublic BigDecimal sum(byte[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on AggregateUtils.sum(byte[])
.
target
- the array of numberspublic BigDecimal sum(short[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on AggregateUtils.sum(short[])
.
target
- the array of numberspublic BigDecimal sum(int[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on AggregateUtils.sum(int[])
.
target
- the array of numberspublic BigDecimal sum(long[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on AggregateUtils.sum(long[])
.
target
- the array of numberspublic BigDecimal sum(float[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on AggregateUtils.sum(float[])
.
target
- the array of numberspublic BigDecimal sum(double[] target)
Returns the sum of all the numbers contained in the provided array.
This method delegates on AggregateUtils.sum(double[])
.
target
- the array of numberspublic BigDecimal avg(Iterable<? extends 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)
.
target
- the iterable containing the number objectspublic BigDecimal avg(Number[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on AggregateUtils.avg(Object[])
.
target
- the array of numberspublic BigDecimal avg(byte[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on AggregateUtils.avg(byte[])
.
target
- the array of numberspublic BigDecimal avg(short[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on AggregateUtils.avg(short[])
.
target
- the array of numberspublic BigDecimal avg(int[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on AggregateUtils.avg(int[])
.
target
- the array of numberspublic BigDecimal avg(long[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on AggregateUtils.avg(long[])
.
target
- the array of numberspublic BigDecimal avg(float[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on AggregateUtils.avg(float[])
.
target
- the array of numberspublic BigDecimal avg(double[] target)
Returns the average of all the numbers contained in the provided array.
This method delegates on AggregateUtils.avg(double[])
.
target
- the array of numbersCopyright © 2017 The THYMELEAF team. All rights reserved.