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 ofItemto a respective list ofQuantityType.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:GroupFunctionCalculates the group state and returns it as a state of the requested type.- Specified by:
getStateAsin 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:GroupFunctionReturns the parameters of the function as an array.- Specified by:
getParametersin interfaceGroupFunction- Returns:
- the parameters of this function
-
toQuantityTypesOfUnit
Convert a set ofItemto a respective list ofQuantityType. Exclude anyItems whose currentStateis not aQuantityType. Convert any remainingQuantityTypeto the 'referenceUnit' and exclude any values that did not convert.- Parameters:
items- a list ofItem- Returns:
- a list of
QuantityTypeconverted to the 'referenceUnit'
-