Package org.openhab.core.library.types
Class QuantityTypeArithmeticGroupFunction.Sum
java.lang.Object
org.openhab.core.library.types.QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
org.openhab.core.library.types.QuantityTypeArithmeticGroupFunction.Sum
- All Implemented Interfaces:
GroupFunction
- Enclosing interface:
QuantityTypeArithmeticGroupFunction
public static class QuantityTypeArithmeticGroupFunction.Sum
extends QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
Calculates the sum of a set of item states whose value could be converted to the 'referenceUnit'.
Uses the
QuantityType.add(org.openhab.core.library.types.QuantityType<T>)
method so the result is an incremental sum based on the 'referenceUnit'. As
a general rule this class is instantiated with a 'referenceUnit' that is a "system unit" (which are zero based)
so such incremental sum is in fact also an absolute sum. However the class COULD be instantiated with a "non-
system unit" (e.g. °C, °F) in which case the result would be an incremental sum based on that unit.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openhab.core.items.GroupFunction
GroupFunction.Equality
-
Field Summary
Fields inherited from class org.openhab.core.library.types.QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
baseItemUnit, systemUnit
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.openhab.core.library.types.QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
getParameters, getStateAs, toQuantityTypesOfUnit
-
Constructor Details
-
Sum
public Sum(javax.measure.Unit<?> baseItemUnit)
-
-
Method Details
-
calculate
Description copied from interface:GroupFunction
Determines the current state of a group based on a list of items- Parameters:
items
- the items to calculate a group state for- Returns:
- the calculated group state
-