Class ListenerSupport<T extends java.util.EventListener>

  • All Implemented Interfaces:
    java.lang.Iterable<T>

    public final class ListenerSupport<T extends java.util.EventListener>
    extends java.lang.Object
    implements java.lang.Iterable<T>

    Base class for a collection of listeners

    Since:
    1.0
    Version:
    7.4
    Author:
    Michael Grove
    • Constructor Summary

      Constructors 
      Constructor Description
      ListenerSupport()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(T theListener)
      Adds the specified listener to the list
      static <T extends java.util.EventListener>
      ListenerSupport<T>
      create()
      Create a new ListenerSupport
      protected java.util.Collection<T> getListeners()
      Return the registered listeners.
      java.util.Iterator<T> iterator()
      void removeListener​(T theListener)
      Removes the specified listener from the list
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • ListenerSupport

        public ListenerSupport()
    • Method Detail

      • addListener

        public void addListener​(T theListener)
        Adds the specified listener to the list
        Parameters:
        theListener - the listener to add
      • removeListener

        public void removeListener​(T theListener)
        Removes the specified listener from the list
        Parameters:
        theListener - the listener to remove
      • getListeners

        protected java.util.Collection<T> getListeners()
        Return the registered listeners.
        Returns:
        the listeners
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T extends java.util.EventListener>
      • create

        public static <T extends java.util.EventListener> ListenerSupport<T> create()
        Create a new ListenerSupport
        Type Parameters:
        T - the listener type
        Returns:
        a new ListenerSupport