Class AggregateDatumSamples

java.lang.Object
net.solarnetwork.domain.datum.DatumSupport
net.solarnetwork.domain.datum.AggregateDatumSamples
All Implemented Interfaces:
Serializable

public class AggregateDatumSamples extends DatumSupport
An aggregation of datum sample values.
Since:
1.65
Version:
2.0
Author:
matt
See Also:
  • Constructor Details

    • AggregateDatumSamples

      public AggregateDatumSamples()
  • Method Details

    • addSample

      public void addSample(DatumSamplesOperations sample)
      Add all properties of a sample.
      Parameters:
      sample - the sample whose properties should be accumulated into this aggregate
    • average

      public DatumSamples average(int decimalScale, String minPropertyFormat, String maxPropertyFormat)
      Generate a new samples instance as an average of the added samples.
      Parameters:
      decimalScale - the average decimal scale
      minPropertyFormat - an optional string template to generate a "minimum" property name with; will be passed a single string parameter
      maxPropertyFormat - an optional string template to generate a "maximum" property name with; will be passed a single string parameter
      Returns:
      the new samples instance, never null
      Since:
      1.1
    • addedSampleCount

      public int addedSampleCount()
      Get the count of samples added via addSample(DatumSamplesOperations).
      Returns:
      the count
    • putInstantaneousSampleValue

      public void putInstantaneousSampleValue(String key, Number n)
      Put a value into or remove a value from the getInstantaneous() map, creating the map if it doesn't exist.
      Parameters:
      key - the key to put
      n - the value to put, or null to remove the key
    • putAccumulatingSampleValue

      public void putAccumulatingSampleValue(String key, Number n)
      Put a value into or remove a value from the getAccumulating() map, creating the map if it doesn't exist.
      Parameters:
      key - the key to put
      n - the value to put, or null to remove the key
    • putStatusSampleValue

      public void putStatusSampleValue(String key, Object value)
      Put a value into or remove a value from the getStatus() map, creating the map if it doesn't exist.
      Parameters:
      key - the key to put
      value - the value to put, or null to remove the key
    • getInstantaneous

      public Map<String,AggregateDatumProperty> getInstantaneous()
      Get the instantaneous properties.
      Returns:
      the instantaneous properties
    • getAccumulating

      public Map<String,AggregateDatumProperty> getAccumulating()
      Get the accumulating properties.
      Returns:
      the accumulating properties
    • getStatus

      public Map<String,Object> getStatus()
      Get the status properties.
      Returns:
      the status properties