Class AbstractEventSupport<E extends EventListener>

    • Constructor Detail

      • AbstractEventSupport

        public AbstractEventSupport()
    • Method Detail

      • notifyAllListeners

        public <O> void notifyAllListeners​(O event,
                                           BiConsumer<E,​O> consumer)
      • hasListeners

        protected boolean hasListeners()
      • addEventListener

        public final void addEventListener​(E listener)
        Adds the specified listener to the list of listeners. Note that this method needs to be synchonized because it performs two independent operations on the underlying list
        Parameters:
        listener - to add
      • removeEventListener

        public final void removeEventListener​(Class cls)
        Removes all event listeners of the specified class. Note that this method needs to be synchonized because it performs two independent operations on the underlying list
        Parameters:
        cls - class of listener to remove
      • removeEventListener

        public final void removeEventListener​(E listener)
      • getEventListeners

        public List<E> getEventListeners()
      • clear

        public void clear()