Class EventGroup


  • public class EventGroup
    extends Object
    A group of related events, all happening as a consequence of the same action.
    Since:
    3.0M2
    Version:
    $Id: 05fdc0f8424d70eefc6246887099801b586cc1c6 $
    • Constructor Detail

      • EventGroup

        public EventGroup()
        Default constructor that creates an empty event group.
      • EventGroup

        public EventGroup​(List<Event> events)
        Constructor that creates a group containing the passed events.
        Parameters:
        events - the list of initial events to put in the group
      • EventGroup

        public EventGroup​(Set<Event> events)
        Constructor that creates a group containing the passed events.
        Parameters:
        events - the list of initial events to put in the group
      • EventGroup

        public EventGroup​(Event... events)
        Constructor that creates a group containing the passed events.
        Parameters:
        events - the list of initial events to put in the group
    • Method Detail

      • getEvents

        public Set<Event> getEvents()
        List the events that are part of this group.
        Returns:
        a read only snapshot of the events in this group; future changes in this group will not be reflected in the returned snapshot
      • addEvents

        public void addEvents​(Event... events)
        Add more events to this group. Duplicate events are added only once, since this is a Set.
        Parameters:
        events - the new events to add
      • clearEvents

        public void clearEvents()
        Remove all the events from this group.
      • getMainEvent

        public Event getMainEvent()
        Get the most important event in this group. The "importance" is given by the importance property of events. If more events have the same maximal importance, the first one found in the group is returned. Usually this corresponds to the order the events were created, but this is not a guaranteed property.
        Returns:
        the most important event found in this group, null if the group is empty.