Package net.solarnetwork.domain.datum
Class AggregateDatumSamples
java.lang.Object
net.solarnetwork.domain.datum.DatumSupport
net.solarnetwork.domain.datum.AggregateDatumSamples
- All Implemented Interfaces:
Serializable
An aggregation of datum sample values.
- Since:
- 1.65
- Version:
- 2.0
- Author:
- matt
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the count of samples added viaaddSample(DatumSamplesOperations).voidaddSample(DatumSamplesOperations sample) Add all properties of a sample.Generate a new samples instance as an average of the added samples.Get the accumulating properties.Get the instantaneous properties.Get the status properties.voidputAccumulatingSampleValue(String key, Number n) Put a value into or remove a value from thegetAccumulating()map, creating the map if it doesn't exist.voidputInstantaneousSampleValue(String key, Number n) Put a value into or remove a value from thegetInstantaneous()map, creating the map if it doesn't exist.voidputStatusSampleValue(String key, Object value) Put a value into or remove a value from thegetStatus()map, creating the map if it doesn't exist.Methods inherited from class net.solarnetwork.domain.datum.DatumSupport
addTag, clear, getMapBigDecimal, getMapDouble, getMapFloat, getMapInteger, getMapLong, getMapString, getT, getTags, hasTag, removeTag, setT, setTags
-
Constructor Details
-
AggregateDatumSamples
public AggregateDatumSamples()
-
-
Method Details
-
addSample
Add all properties of a sample.- Parameters:
sample- the sample whose properties should be accumulated into this aggregate
-
average
Generate a new samples instance as an average of the added samples.- Parameters:
decimalScale- the average decimal scaleminPropertyFormat- an optional string template to generate a "minimum" property name with; will be passed a single string parametermaxPropertyFormat- 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 viaaddSample(DatumSamplesOperations).- Returns:
- the count
-
putInstantaneousSampleValue
Put a value into or remove a value from thegetInstantaneous()map, creating the map if it doesn't exist.- Parameters:
key- the key to putn- the value to put, or null to remove the key
-
putAccumulatingSampleValue
Put a value into or remove a value from thegetAccumulating()map, creating the map if it doesn't exist.- Parameters:
key- the key to putn- the value to put, or null to remove the key
-
putStatusSampleValue
Put a value into or remove a value from thegetStatus()map, creating the map if it doesn't exist.- Parameters:
key- the key to putvalue- the value to put, or null to remove the key
-
getInstantaneous
Get the instantaneous properties.- Returns:
- the instantaneous properties
-
getAccumulating
Get the accumulating properties.- Returns:
- the accumulating properties
-
getStatus
Get the status properties.- Returns:
- the status properties
-