Class CompositeEvent


  • public class CompositeEvent
    extends Object
    A group of similar events that compose a "composite" event.
    Since:
    9.4RC1
    Version:
    $Id: cdafec6fe53a76d687067ccb953b21a33073d7ad $
    • Constructor Detail

      • CompositeEvent

        public CompositeEvent​(Event event)
        Construct a CompositeEvent.
        Parameters:
        event - the first event of the composite event
      • CompositeEvent

        public CompositeEvent​(CompositeEvent compositeEvent)
        Copy constructor of CompositeEvent.
        Parameters:
        compositeEvent - the composite event to copy
    • Method Detail

      • getEventIds

        public List<String> getEventIds()
        Returns:
        the list of the ids of the events
      • add

        public void add​(Event event,
                        int similarity)
                 throws NotificationException
        Add an event to the composite event.
        Parameters:
        event - the event to add
        similarity - the similarity between the event to add and the events of the composite events
        Throws:
        NotificationException - if the addition is illegal (lower similarity for example)
      • getSimilarityBetweenEvents

        public int getSimilarityBetweenEvents()
        Returns:
        the greatest similarity between events of the composite event
      • getEvents

        public List<Event> getEvents()
        Returns:
        the events that compose the current object
      • getType

        public String getType()
        Returns:
        the type of the events that compose the current object
      • getGroupId

        public String getGroupId()
        Returns:
        the groupId of the first event of the current object
      • getDocument

        public org.xwiki.model.reference.DocumentReference getDocument()
        Returns:
        the document of the first event of the current object
      • getUsers

        public Set<org.xwiki.model.reference.DocumentReference> getUsers()
        Returns:
        the users who performed the events
      • getDate

        public Date getDate()
        Returns:
        the date of the most recent event
        Since:
        9.11RC1
      • getDates

        public List<Date> getDates()
        Returns:
        the dates of the events, sorted by descending order
      • remove

        public void remove​(Event event)
        Remove an event from the current object.
        Parameters:
        event - the event to remove
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object