|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.event.EventListenerList echopoint.event.WeakEventListenerList
The WeakEventListenerList
is basically the same as
a nextapp.echo.EventListenerList
except that it uses
WeakReferences to the listeners.
It has the advantage that if a Model class (using this list class) has listeners which forget to remove themselves from the model then they will be automatically cleaned up by the Java Garbage Collector.
It has the disadvantage that if the listener is stand alone, ie. is not strongly reached by any other object, then it will be eligible for garbage collection and hence will disappear from the list.
WeakReference
,
EventListenerList
,
Serialized FormConstructor Summary | |
WeakEventListenerList()
Creates a new WeakEventListenerList |
Method Summary | |
void |
addListener(java.lang.Class listenerClass,
java.util.EventListener l)
Adds a listener of the given class to the list. |
int |
getListenerCount(java.lang.Class listenerClass)
Returns the number of listeners present of the given type. |
java.util.EventListener[] |
getListeners(java.lang.Class listenerClass)
Returns an array of listeners of the given class. |
void |
removeListener(java.lang.Class listenerClass,
java.util.EventListener l)
Removes a listener of the given class from the list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WeakEventListenerList()
Method Detail |
public void addListener(java.lang.Class listenerClass, java.util.EventListener l)
listenerClass
- The Class of the listener being added.l
- The listener to add.public int getListenerCount(java.lang.Class listenerClass)
listenerClass
- The Class of the listener for which the count is
desired.public java.util.EventListener[] getListeners(java.lang.Class listenerClass)
listenerClass
- The Class of listeners which should be returned.
public void removeListener(java.lang.Class listenerClass, java.util.EventListener l)
listenerClass
- The Class of the listener being removed.l
- The listener to remove.
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |