Package net.solarnetwork.domain.datum
Class AggregateDatumProperty
java.lang.Object
net.solarnetwork.domain.datum.AggregateDatumProperty
An aggregate datum property.
- Since:
- 1.65
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulate(BigDecimal val) Accumulate another value.average(int decimalScale) Compute the average value of all accumulated values.first()Get the first accumulated value.intgetCount()Get the count of accumulated values.getMax()Get the maximum accumulated value.getMin()Get the minimum accumulated value.getTotal()Get the total sum of accumulated values.last()Get the last accumulated value.
-
Constructor Details
-
AggregateDatumProperty
Constructor.- Parameters:
val- the initial value
-
-
Method Details
-
accumulate
Accumulate another value.- Parameters:
val- the value to accumulate
-
average
Compute the average value of all accumulated values.- Parameters:
decimalScale- the maximum decimal scale to round to- Returns:
- the average value
-
getCount
public int getCount()Get the count of accumulated values.- Returns:
- the count of values
-
getTotal
Get the total sum of accumulated values.- Returns:
- the total sum of values
-
getMin
Get the minimum accumulated value.- Returns:
- the min
-
getMax
Get the maximum accumulated value.- Returns:
- the max
-
first
Get the first accumulated value.- Returns:
- the first value, never null
-
last
Get the last accumulated value.- Returns:
- the last value, never null
-