org.PingOO.DLAI.lib.appli.event
Class SlaveEventListenerList

java.lang.Object
  |
  +--org.PingOO.DLAI.lib.appli.event.SlaveEventListenerList

public class SlaveEventListenerList
extends java.lang.Object

Manages a shared list of SlaveListeners.
Inspired by javax.swing.evet.EventListenerList.java, but it does not extend it for performance reasons.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)
See Also:
EventListenerList

Field Summary
private  SlaveListener[] listenerList
          The list of SlaveListeners.
 
Constructor Summary
SlaveEventListenerList()
          Creates a new SlaveEventListenerList.
 
Method Summary
 void add(SlaveListener listener)
          Adds the specified listener to the list.
 int getListenerCount()
          Returns the total number of listeners for this listenerlist.
 SlaveListener[] getListenerList()
          This passes back the event listener list as an array of SlaveListener.
 void remove(SlaveListener listener)
          Removes the specified listener from the list.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

listenerList

private SlaveListener[] listenerList
The list of SlaveListeners.
Constructor Detail

SlaveEventListenerList

public SlaveEventListenerList()
Creates a new SlaveEventListenerList.
Method Detail

getListenerList

public SlaveListener[] getListenerList()
This passes back the event listener list as an array of SlaveListener.
Note that for performance reasons, this implementation passes back the actual data structure in which the listner data is stored internally!
This method is guaranteed to pass back a non-null array, so that no null-checking is required in fire methods.
A zero-length array of Object should be returned if there are currently no listeners.

WARNING!!! Absolutely NO modification of the data contained in this array should be made.
if any such manipulation is necessary, it should be done on a copy of the array returned rather than the array itself.

Returns:
The SlaveListener array.

getListenerCount

public int getListenerCount()
Returns the total number of listeners for this listenerlist.
Returns:
The total number of listeners for this listenerlist.

add

public void add(SlaveListener listener)
Adds the specified listener to the list.
Parameters:
listener - The listener to be added.

remove

public void remove(SlaveListener listener)
Removes the specified listener from the list.
Parameters:
listener - The listener to be removed.