T
- type of listenerspublic abstract class ListenerCollection<T> extends Object implements Serializable, Iterable<T>
NOTE: Ordering of listeners is not guaranteed and should not be relied upon
Modifier and Type | Class and Description |
---|---|
protected static interface |
ListenerCollection.INotifier<T>
Used to notify a listener.
|
Constructor and Description |
---|
ListenerCollection() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T listener)
Adds a listener to this set of listeners.
|
protected boolean |
isAllowingDuplicates()
Whether or not added listeners should be checked for duplicates.
|
protected boolean |
isAllowingNulls()
Whether or not to allow
null s in listener collection. |
Iterator<T> |
iterator()
Returns an iterator that can iterate the listeners.
|
protected void |
notify(ListenerCollection.INotifier<T> notifier)
Notifies each listener in this
|
protected void |
notifyIgnoringExceptions(ListenerCollection.INotifier<T> notifier)
Notifies each listener in this set ignoring exceptions.
|
void |
remove(T listener)
Removes a listener from this set.
|
protected void |
reversedNotify(ListenerCollection.INotifier<T> notifier)
Notifies each listener in this in reversed order
|
protected void |
reversedNotifyIgnoringExceptions(ListenerCollection.INotifier<T> notifier)
Notifies each listener in this set in reverse order ignoring exceptions
|
public boolean add(T listener)
listener
- The listener to addtrue
if the listener was addedprotected void notify(ListenerCollection.INotifier<T> notifier)
notifier
- notifier used to notify each listenerprotected void notifyIgnoringExceptions(ListenerCollection.INotifier<T> notifier)
notifier
- notifier used to notify each listenerprotected void reversedNotifyIgnoringExceptions(ListenerCollection.INotifier<T> notifier)
notifier
- notifier used to notify each listenerprotected void reversedNotify(ListenerCollection.INotifier<T> notifier)
notifier
- notifier used to notify each listenerpublic void remove(T listener)
listener
- The listener to removeprotected boolean isAllowingDuplicates()
true
to ignore duplicatesprotected boolean isAllowingNulls()
null
s in listener collection.
true to allow nulls to be added to the collectionCopyright © 2006–2021 Apache Software Foundation. All rights reserved.