Class AggregateDatumProperty

java.lang.Object
net.solarnetwork.domain.datum.AggregateDatumProperty

public class AggregateDatumProperty extends Object
An aggregate datum property.
Since:
1.65
Version:
1.0
Author:
matt
  • Constructor Details

    • AggregateDatumProperty

      public AggregateDatumProperty(BigDecimal val)
      Constructor.
      Parameters:
      val - the initial value
  • Method Details

    • accumulate

      public void accumulate(BigDecimal val)
      Accumulate another value.
      Parameters:
      val - the value to accumulate
    • average

      public BigDecimal average(int decimalScale)
      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

      public BigDecimal getTotal()
      Get the total sum of accumulated values.
      Returns:
      the total sum of values
    • getMin

      public BigDecimal getMin()
      Get the minimum accumulated value.
      Returns:
      the min
    • getMax

      public BigDecimal getMax()
      Get the maximum accumulated value.
      Returns:
      the max
    • first

      public BigDecimal first()
      Get the first accumulated value.
      Returns:
      the first value, never null
    • last

      public BigDecimal last()
      Get the last accumulated value.
      Returns:
      the last value, never null