Package com.complexible.common.util

# Class ListenerSupport<T extends EventListener>

java.lang.Object
com.complexible.common.util.ListenerSupport<T>

All Implemented Interfaces:
  `Iterable<T>`

public final class ListenerSupport<T extends EventListener> extends Object implements 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

  Modifier and Type
  Method
  Description
  `void`
  `addListener(T theListener)`
  Adds the specified listener to the list
  `static <T extends EventListener>
  ListenerSupport<T>`
  `create()`
  Create a new ListenerSupport
  `void`
  `forEach(Consumer<? super T> action)`
  `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

  `spliterator`

- ## Constructor Details

  - ### ListenerSupport

    public ListenerSupport()

- ## Method Details

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

  - ### forEach

    public void forEach(Consumer<? super T> action)
    Specified by:
      `forEach` in interface `Iterable<T extends EventListener>`

  - ### iterator

    @Nonnull public Iterator<T> iterator()
    Specified by:
      `iterator` in interface `Iterable<T extends EventListener>`

  - ### create

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