TypeSafeEventListenerSource
- Author: Simon Wacker
- Classpath: org.as2lib.env.event.TypeSafeEventListenerSource
- File last modified: Tuesday, 19 April 2005, 18:20:34
TypeSafeEventListenerSource manages listeners in a type-safe manner. Summary
- getListenerType
- isListenerTypeChecked
- addListener
- addAllListeners
- removeListener
- removeAllListeners
- getAllListeners
Constructor
TypeSafeEventListenerSource
TypeSafeEventListenerSource instance.checkListenerType is by default set to true.
Instance methods
addAllListeners
listeners array.If the passed-in listeners array is null or undefined
it will be ignored.
The individual listeners must be instances of the type specified on
construction. If an individual listener is null or undefined it
will be ignored.
All listeners that are of the correct type will be added.
Note that the listener type will not be checked if it was turned of on construction.
Note also that the order of the listeners contained in the passed-in
listeners array is preserved.
listeners array is not of the expected type specified on constructionaddListener
listener.The listener will only be added if it is not null nor undefined
and if it is of the expected listener type specified on construction.
Note that if the passed-in listener has already been added the
previously added one will be removed.
Note also that the listener type will not be checked if it was turned of on construction.
listener is not of the
expected type specified on constructiongetAllListeners
getListenerType
isListenerTypeChecked
true a listener's type is checked else falseremoveAllListeners
removeListener
listener.The removal will be ignored if the passed-in listener is null
or undefined.