org.apache.pivot.util
Class ListenerList<T>
java.lang.Object
org.apache.pivot.util.ListenerList<T>
- All Implemented Interfaces:
- Iterable<T>
- Direct Known Subclasses:
- Image.ImageListenerList, List.ListListenerList, ListView.ItemEditor.ItemEditorListenerList, Map.MapListenerList, Movie.MovieListenerList, Queue.QueueListenerList, Set.SetListenerList, Stack.StackListenerList, TableView.RowEditor.RowEditorListenerList, TreeView.NodeEditor.NodeEditorListenerList
public abstract class ListenerList<T>
- extends Object
- implements Iterable<T>
Abstract base class for listener lists.
NOTE This class is not inherently thread safe. Subclasses that require
thread-safe access should synchronize method access appropriately. Callers
must manually synchronize on the listener list instance to ensure thread
safety during iteration.
Method Summary |
void |
add(T listener)
Adds a listener to the list, if it has not previously been added. |
Iterator<T> |
iterator()
|
void |
remove(T listener)
Removes a listener from the list, if it has previously been added. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListenerList
public ListenerList()
add
public void add(T listener)
- Adds a listener to the list, if it has not previously been added.
- Parameters:
listener
-
remove
public void remove(T listener)
- Removes a listener from the list, if it has previously been added.
- Parameters:
listener
-
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>