|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.thymeleaf.expression.Aggregates
public final class Aggregates
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 Summary | |
---|---|
Aggregates()
Create an object of this class. |
Method Summary | |
---|---|
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. a collection). |
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. a collection). |
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Aggregates()
Create an object of this class.
Normally, this is only executed internally by the expression evaluation subsystems in dialects.
Method Detail |
---|
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 objects
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
public 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 objects
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
public 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 numbers
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |