Interface GroupFunction

All Known Subinterfaces:
ArithmeticGroupFunction, DateTimeGroupFunction, QuantityTypeArithmeticGroupFunction
All Known Implementing Classes:
ArithmeticGroupFunction.And, ArithmeticGroupFunction.Avg, ArithmeticGroupFunction.Count, ArithmeticGroupFunction.Max, ArithmeticGroupFunction.Min, ArithmeticGroupFunction.NAnd, ArithmeticGroupFunction.NOr, ArithmeticGroupFunction.Or, ArithmeticGroupFunction.Sum, DateTimeGroupFunction.Earliest, DateTimeGroupFunction.Latest, GroupFunction.Equality, QuantityTypeArithmeticGroupFunction.Avg, QuantityTypeArithmeticGroupFunction.DimensionalGroupFunction, QuantityTypeArithmeticGroupFunction.Max, 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 Classes
    Modifier and Type
    Interface
    Description
    static class 
    This is the default group function that does nothing else than to check if all member items have the same state.
  • Method Summary

    Modifier and Type
    Method
    Description
    calculate(@Nullable Set<Item> items)
    Determines the current state of a group based on a list of items
    Returns the parameters of the function as an array.
    <T extends State>
    @Nullable T
    getStateAs(@Nullable Set<Item> items, Class<T> stateClass)
    Calculates the group state and returns it as a state of the requested type.
  • Method Details

    • calculate

      State calculate(@Nullable Set<Item> items)
      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

      <T extends State> @Nullable T getStateAs(@Nullable Set<Item> items, Class<T> stateClass)
      Calculates the group state and returns it as a state of the requested type.
      Parameters:
      items - the items to calculate a group state for
      stateClass - 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