Package com.complexible.common.util
Class ListenerSupport<T extends java.util.EventListener>
- java.lang.Object
-
- com.complexible.common.util.ListenerSupport<T>
-
- 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 liststatic <T extends java.util.EventListener>
ListenerSupport<T>create()
Create a new ListenerSupportprotected 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
-
-
-
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 interfacejava.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
-
-