Class CumulativeEvent

  • All Implemented Interfaces:
    Cloneable, Comparable<IdAble>, Event, IdAble
    Direct Known Subclasses:
    ReleaseEvent, TriggerEvent

    public abstract class CumulativeEvent
    extends EventImpl
    A cumulative event represents a cumulative pcu point in space-time with (potential) additional information. The content of the event is stored in a raw object array which is initialised here. The first two entries are populated with the unique id of the event and the cumulative information.
    Author:
    markr
    • Constructor Detail

      • CumulativeEvent

        protected CumulativeEvent​(EventType type,
                                  Object source,
                                  CumulativePoint cumulativePoint,
                                  Serializable singleParameter)
        Constructor of an LTM cumulative event.
        Parameters:
        type - of the event
        source - of the event (where does it originate from)
        cumulativePoint - contains the cumulative information
        singleParameter - create room in the content array for additional content of derived event classes
      • CumulativeEvent

        protected CumulativeEvent​(EventType type,
                                  Serializable sourceId,
                                  CumulativePoint cumulativePoint,
                                  Serializable... additionalContent)
        Constructor of an LTM cumulative event.
        Parameters:
        type - of the event
        sourceId - of the event (where does it originate from)
        cumulativePoint - contains the cumulative information
        additionalContent - create room in the content array for additional content of derived event classes
    • Method Detail

      • generateEventId

        protected static long generateEventId()
        Event ids are generated with unique ids across all cumulative events in the JVM
        Returns:
        geenerated event id
      • getEventContentByIndex

        protected <T> T getEventContentByIndex​(int index)
        Collect any entry from the event content object array by index and cast to generic type T
        Type Parameters:
        T - content type
        Parameters:
        index - of the content object array to retrieve
        Returns:
        entry type cast to T
      • setEventContentByIndex

        protected void setEventContentByIndex​(int index,
                                              Serializable contentEntry)
        set content entry on the event explicitly
        Parameters:
        index - location in the content object array
        contentEntry - the entry
      • getId

        public long getId()
        Description copied from class: IdAbleImpl
        Collect id of the entity
        Specified by:
        getId in interface IdAble
        Overrides:
        getId in class IdAbleImpl
        Returns:
        the unique id
      • getCumulativePoint

        public final CumulativePoint getCumulativePoint()
        Returns:
        the cumulative point