|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hivemind.util.EventListenerList
public class EventListenerList
Convienience class for tracking a list of event listeners. Works efficiently (using a copy-on-write approach) to iterating through the listeners in the list even when the list of listeners may be modified.
EventListenerList is thread-safe.
| Constructor Summary | |
|---|---|
EventListenerList()
|
|
| Method Summary | |
|---|---|
void |
addListener(java.lang.Object listener)
Adds a new listener to the list of listeners. |
java.util.Iterator |
getListeners()
Returns an Iterator used to find all the listeners previously added. |
void |
removeListener(java.lang.Object listener)
Removes a listener from the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventListenerList()
| Method Detail |
|---|
public java.util.Iterator getListeners()
remove() on the Iterator.
Invoking this method takes a "snapshot" of the current list of listeners.
You may invoke addListener(Object) or removeListener(Object),
but that won't affect the sequence of listeners returned by the Iterator.
public void addListener(java.lang.Object listener)
public void removeListener(java.lang.Object listener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||