Package org.openhab.core.items
Interface GroupFunction
- All Known Subinterfaces:
ArithmeticGroupFunction
,DateTimeGroupFunction
,QuantityTypeArithmeticGroupFunction
- All Known Implementing Classes:
ArithmeticGroupFunction.And
,ArithmeticGroupFunction.Avg
,ArithmeticGroupFunction.Count
,ArithmeticGroupFunction.Max
,ArithmeticGroupFunction.Median
,ArithmeticGroupFunction.Min
,ArithmeticGroupFunction.NAnd
,ArithmeticGroupFunction.NOr
,ArithmeticGroupFunction.Or
,ArithmeticGroupFunction.Sum
,ArithmeticGroupFunction.Xor
,DateTimeGroupFunction.Earliest
,DateTimeGroupFunction.Latest
,GroupFunction.Equality
,QuantityTypeArithmeticGroupFunction.Avg
,QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction
,QuantityTypeArithmeticGroupFunction.Max
,QuantityTypeArithmeticGroupFunction.Median
,QuantityTypeArithmeticGroupFunction.Min
,QuantityTypeArithmeticGroupFunction.Sum
@NonNullByDefault
public interface GroupFunction
Group functions are used by active group items to calculate a state for the group
out of the states of all its member items.
- Author:
- Kai Kreuzer - Initial contribution
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
This is the default group function that does nothing else than to check if all member items have the same state. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
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
-
EQUALITY
- See Also:
-
AND
- See Also:
-
OR
- See Also:
-
NAND
- See Also:
-
NOR
- See Also:
-
XOR
- See Also:
-
COUNT
- See Also:
-
AVG
- See Also:
-
MEDIAN
- See Also:
-
SUM
- See Also:
-
MIN
- See Also:
-
MAX
- See Also:
-
LATEST
- See Also:
-
EARLIEST
- See Also:
-
DEFAULT
- See Also:
-
VALID_FUNCTIONS
-
-
Method Details
-
calculate
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
-
getStateAs
Calculates the group state and returns it as a state of the requested type.- 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
State[] getParameters()Returns the parameters of the function as an array.- Returns:
- the parameters of this function
-