Package org.openhab.core.library.types
Class ArithmeticGroupFunction.Count
java.lang.Object
org.openhab.core.library.types.ArithmeticGroupFunction.Count
- All Implemented Interfaces:
GroupFunction
- Enclosing interface:
- ArithmeticGroupFunction
This calculates the number of items in the group matching the
regular expression passed in parameter
Group:Number:COUNT(".") will count all items having a string state of one character
Group:Number:COUNT("[5-9]") will count all items having a string state between 5 and 9
...
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openhab.core.items.GroupFunction
GroupFunction.Equality
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDetermines the current state of a group based on a list of itemsState[]
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.
-
Field Details
-
pattern
-
-
Constructor Details
-
Count
-
-
Method Details
-
calculate
Description copied from interface:GroupFunction
Determines the current state of a group based on a list of items- Specified by:
calculate
in interfaceGroupFunction
- Parameters:
items
- the items to calculate a group state for- Returns:
- the calculated group state
-
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
-