lt.monarch.util.listener
Class WeakListenerList<E>

java.lang.Object
  extended by lt.monarch.util.listener.WeakListenerList<E>
All Implemented Interfaces:
ListenerList<E>

public class WeakListenerList<E>
extends java.lang.Object
implements ListenerList<E>


Constructor Summary
Constructor and Description
WeakListenerList(E[] initialList)
          Creates new listeners list from specified initial listeners.
 
Method Summary
Modifier and Type Method and Description
 void addListener(E l)
          Adds new listener to listeners list.
 E[] getListeners()
          Returns listeners as an array.
 void removeListener(E l)
          Removes listener from listeners list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakListenerList

public WeakListenerList(E[] initialList)
Creates new listeners list from specified initial listeners.

Parameters:
initialList - initial listeners list.
Throws:
java.lang.IllegalArgumentException - if initial listeners list is null.
Method Detail

addListener

public final void addListener(E l)
Adds new listener to listeners list.

Specified by:
addListener in interface ListenerList<E>
Parameters:
l - listener which will be added to listeners list.

removeListener

public final void removeListener(E l)
Removes listener from listeners list.

Specified by:
removeListener in interface ListenerList<E>
Parameters:
l - listener which will be removed from listeners list.

getListeners

public final E[] getListeners()
Returns listeners as an array.

Specified by:
getListeners in interface ListenerList<E>
Returns:
array of listeners