com.droplets.api.event
Class EventListenerList
java.lang.Object
|
+--com.droplets.api.event.EventListenerList
- All Implemented Interfaces:
- java.io.Serializable
- public class EventListenerList
- extends java.lang.Object
- implements java.io.Serializable
This class mimics javax.swing.event.EventListenerList
. See the Javadoc for
that class. It also provides a removeAll
method to
deregister all listeners at once.
- See Also:
- Serialized Form
Method Summary |
void |
add(java.lang.Class cls,
java.util.EventListener l)
Adds the listener specified by the second arg to the list. |
int |
getListenerCount()
Returns the number of listeners in this list. |
int |
getListenerCount(java.lang.Class t)
Returns the number of listeners of the supplied type in this list. |
java.lang.Object[] |
getListenerList()
Gets an array of all listeners. |
void |
remove(java.lang.Class cls,
java.util.EventListener l)
Removes a listener. |
void |
removeAll()
Removes all listeners. |
java.lang.String |
toString()
Gets a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
listenerList
protected transient java.lang.Object[] listenerList
EventListenerList
public EventListenerList()
getListenerList
public java.lang.Object[] getListenerList()
- Gets an array of all listeners.
- Returns:
- an array of all listeners
getListenerCount
public int getListenerCount()
- Returns the number of listeners in this list.
getListenerCount
public int getListenerCount(java.lang.Class t)
- Returns the number of listeners of the supplied type in this list.
add
public void add(java.lang.Class cls,
java.util.EventListener l)
- Adds the listener specified by the second arg to the list. The first arg
should describe the listener's type.
- Parameters:
cls
- the type of the listener to be addedl
- the listener to be added- Throws:
java.lang.IllegalArgumentException
- if the second argument's type is
not the first argument
remove
public void remove(java.lang.Class cls,
java.util.EventListener l)
- Removes a listener.
- Parameters:
cls
- the type of the listener to be removedl
- the listener to be removed- Throws:
java.lang.IllegalArgumentException
- if the second argument's type is
not the first argument
removeAll
public void removeAll()
- Removes all listeners.
toString
public java.lang.String toString()
- Gets a string representation of this object. Useful for debugging.
- Overrides:
toString
in class java.lang.Object
Copyright © Droplets, 2001. All Rights Reserved.