Class ConsumableEvent

    • Constructor Detail

      • ConsumableEvent

        public ConsumableEvent​(Object source)
        Constructs a prototypical Event.
        Parameters:
        source - The object on which the Event initially occurred.
        Throws:
        IllegalArgumentException - if source is null.
      • ConsumableEvent

        public ConsumableEvent​(Object source,
                               boolean disappearWhenConsumed)
        Constructs a prototypical Event.
        Parameters:
        source - The object on which the Event initially occurred.
        disappearWhenConsumed - indicates if the event is supposed to disappear when it was consumed.
        Throws:
        IllegalArgumentException - if source is null.
    • Method Detail

      • isConsumed

        @Pure
        public boolean isConsumed()
        Replies if this object was already marked as consumed.
        Returns:
        true if the event was consumed, otherwise false
      • consume

        public void consume()
        Mark this event as consumed.
      • isDisappearingWhenConsumed

        @Pure
        public boolean isDisappearingWhenConsumed()
        Replies if this event should disappear when it was consumed.

        The use of this flag depends on the event forwarder implementations.

        Returns:
        true if the event is supposed to diseappear after its consumption, otherwise false