nextapp.echo.event
Class EventListenerList

java.lang.Object
  extended by nextapp.echo.event.EventListenerList
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WeakEventListenerList

public class EventListenerList
extends java.lang.Object
implements java.io.Serializable

A generic storage facility for listeners.

See Also:
Serialized Form

Constructor Summary
EventListenerList()
          Creates a new listener list.
 
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

EventListenerList

public EventListenerList()
Creates a new listener list.

Method Detail

addListener

public void addListener(java.lang.Class listenerClass,
                        java.util.EventListener l)
Adds a listener of the given class to the list.

Parameters:
listenerClass - The Class of the listener being added.
l - The listener to add.

getListenerCount

public int getListenerCount(java.lang.Class listenerClass)
Returns the number of listeners present of the given type.

Parameters:
listenerClass - The Class of the listener for which the count is desired.

getListeners

public java.util.EventListener[] getListeners(java.lang.Class listenerClass)
Returns an array of listeners of the given class.

Parameters:
listenerClass - The Class of listeners which should be returned.
Returns:
An array of listeners of the given Class. If no listeners of the specified class exist, an empty array is returned.

removeListener

public void removeListener(java.lang.Class listenerClass,
                           java.util.EventListener l)
Removes a listener of the given class from the list.

Parameters:
listenerClass - The Class of the listener being removed.
l - The listener to remove.