Package org.openhab.core.library.types
Class QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
java.lang.Object
org.openhab.core.library.types.QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
- All Implemented Interfaces:
GroupFunction
- Direct Known Subclasses:
QuantityTypeArithmeticGroupFunction.Avg
,QuantityTypeArithmeticGroupFunction.Max
,QuantityTypeArithmeticGroupFunction.Median
,QuantityTypeArithmeticGroupFunction.Min
,QuantityTypeArithmeticGroupFunction.Sum
- Enclosing interface:
QuantityTypeArithmeticGroupFunction
public abstract static class QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
extends Object
implements GroupFunction
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openhab.core.items.GroupFunction
GroupFunction.Equality
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final javax.measure.Unit
<?> protected final javax.measure.Unit
<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionState[]
Returns the parameters of the function as an array.<T extends State>
@Nullable TgetStateAs
(@Nullable Set<Item> items, Class<T> stateClass) Calculates the group state and returns it as a state of the requested type.protected List
<QuantityType> toQuantityTypesOfUnit
(Set<Item> items, javax.measure.Unit<?> unit) Convert a set ofItem
to a respective list ofQuantityType
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openhab.core.items.GroupFunction
calculate
-
Field Details
-
baseItemUnit
protected final javax.measure.Unit<?> baseItemUnit -
systemUnit
protected final javax.measure.Unit<?> systemUnit
-
-
Constructor Details
-
DimensionalGroupFunction
public DimensionalGroupFunction(javax.measure.Unit<?> baseItemUnit)
-
-
Method Details
-
getStateAs
Description copied from interface:GroupFunction
Calculates the group state and returns it as a state of the requested type.- Specified by:
getStateAs
in interfaceGroupFunction
- Parameters:
items
- the items to calculate a group state forstateClass
- the type in which the state should be returned- Returns:
- the calculated group state of the requested type or null, if type is not supported
-
getParameters
Description copied from interface:GroupFunction
Returns the parameters of the function as an array.- Specified by:
getParameters
in interfaceGroupFunction
- Returns:
- the parameters of this function
-
toQuantityTypesOfUnit
Convert a set ofItem
to a respective list ofQuantityType
. Exclude anyItem
s whose currentState
is not aQuantityType
. Convert any remainingQuantityType
to the 'referenceUnit' and exclude any values that did not convert.- Parameters:
items
- a list ofItem
- Returns:
- a list of
QuantityType
converted to the 'referenceUnit'
-