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