org.apache.commons.net.util

## Class ListenerList<T extends EventListener>

- java.lang.Object
- - org.apache.commons.net.util.ListenerList<T>

- Type Parameters:
    `T` - the type of elements returned by the iterator
  All Implemented Interfaces:
    Serializable, Iterable<T>

      public class ListenerList<T extends EventListener>
      extends Object
      implements Serializable, Iterable<T>

  A list of event listeners.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ListenerList()` Constructs a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(T listener)` Adds the given listener to the end of this list.
    `int` | `getListenerCount()` Gets the number of elements in this list.
    `boolean` | `isEmpty()` Tests whether if this listener list is empty.
    `Iterator<T>` | `iterator()` Return an `Iterator` for the `EventListener` instances.
    `void` | `removeListener(T listener)` Removes the first occurrence of the specified listener from this list, if it is present.

    - ### 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

    - #### ListenerList

          public ListenerList()

      Constructs a new instance.

  - ### Method Detail

    - #### addListener

          public void addListener(T listener)

      Adds the given listener to the end of this list.
      Parameters:
        `listener` - A listener.

    - #### getListenerCount

          public int getListenerCount()

      Gets the number of elements in this list.
      Returns:
        the number of elements in this list

    - #### isEmpty

          public boolean isEmpty()

      Tests whether if this listener list is empty.
      Returns:
        whether if this listener list is empty.

    - #### iterator

          public Iterator<T> iterator()

      Return an `Iterator` for the `EventListener` instances.
      Specified by:
        `iterator` in interface `Iterable<T extends EventListener>`
      Returns:
        an `Iterator` for the `EventListener` instances

    - #### removeListener

          public void removeListener(T listener)

      Removes the first occurrence of the specified listener from this list, if it is present.
      Parameters:
        `listener` - listener to be removed from this list, if present.