Package com.complexible.common.util
Class ListenerSupport<T extends EventListener>
java.lang.Object
com.complexible.common.util.ListenerSupport<T>
- All Implemented Interfaces:
Iterable<T>
Base class for a collection of listeners
- Since:
- 1.0
- Version:
- 7.4
- Author:
- Michael Grove
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(T theListener) Adds the specified listener to the liststatic <T extends EventListener>
ListenerSupport<T> create()Create a new ListenerSupportvoiditerator()voidremoveListener(T theListener) Removes the specified listener from the listMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
spliterator
-
Constructor Details
-
ListenerSupport
public ListenerSupport()
-
-
Method Details
-
addListener
Adds the specified listener to the list- Parameters:
theListener- the listener to add
-
removeListener
Removes the specified listener from the list- Parameters:
theListener- the listener to remove
-
forEach
- Specified by:
forEachin interfaceIterable<T extends EventListener>
-
iterator
- Specified by:
iteratorin interfaceIterable<T extends EventListener>
-
create
Create a new ListenerSupport- Type Parameters:
T- the listener type- Returns:
- a new ListenerSupport
-