Interface EventSource

    • Method Detail

      • updateEventListener

        java.util.List<EventListener> updateEventListener()
        Returns:
        list containing all update event listener (needs to be provided by implementing class)
      • addListener

        default void addListener​(EventListener listener)
        Adds an EventListener which will be notified whenever the Observable becomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

        Note that the same actual InvalidationListener instance may be safely registered for different UpdateSource.

        The UpdateSource stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak.

        Parameters:
        listener - The listener to register
        Throws:
        java.lang.NullPointerException - if the listener is null
        See Also:
        removeListener(EventListener)
      • removeListener

        default void removeListener​(EventListener listener)
        Removes the given listener from the list of listeners, that are notified whenever the value of the UpdateSource becomes invalid.

        If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

        Parameters:
        listener - The listener to remove
        Throws:
        java.lang.NullPointerException - if the listener is null
        See Also:
        addListener(EventListener)
      • invokeListener

        default void invokeListener()
        invoke object within update listener list
      • invokeListener

        default void invokeListener​(UpdateEvent updateEvent)
        invoke object within update listener list
        Parameters:
        updateEvent - the event the listeners are notified with