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

java.lang.Object
  extended by lt.monarch.util.listener.DefaultListenerList<E>
All Implemented Interfaces:
java.io.Serializable, ListenerList<E>

public class DefaultListenerList<E>
extends java.lang.Object
implements ListenerList<E>, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Constructor and Description
DefaultListenerList(E[] initialList)
          Creates new listeners list from specified initial listeners list.
 
Method Summary
Modifier and Type Method and Description
 void addListener(E l)
          Adds new listener to listeners list.
 E[] getListeners()
          Returns listeners from listeners list.
 void removeAllListeners()
          Removes all listeners
 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

DefaultListenerList

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

Parameters:
initialList - initial listeners list.
Throws:
java.lang.IllegalArgumentException - if an illegal or inappropriate initial listeners list is passed to method.
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 from listeners list.

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

removeAllListeners

public final void removeAllListeners()
Removes all listeners