Class goog.events.ListenerMap
code »Creates a new listener map.
Constructor
| Parameters |
|---|
|
Instance Methods
code »add ( type, listener, callOnce, opt_useCapture, opt_listenerScope ) ⇒ goog.events.ListenableKeyAdds an event listener. A listener can only be added once to an
object and if it is added again the key for the listener is
returned.
Note that a one-off listener will not change an existing listener,
if any. On the other hand a normal listener will change existing
one-off listener to become a normal listener.
goog.events.ListenableKey| Parameters |
|---|
| Returns |
|
code »getListener ( type, listener, capture, opt_listenerScope ) ⇒ goog.events.ListenableKeyGets the goog.events.ListenableKey for the event or null if no such
listener is in use.
goog.events.ListenableKey| Parameters |
|---|
|
| Returns |
|
code »getListenerCount ( ) ⇒ number
number| Returns |
|---|
|
code »getListeners ( type, capture ) ⇒ !Array.<goog.events.ListenableKey>Gets all listeners that match the given type and capture mode. The
returned array is a copy (but the listener objects are not).
!Array.<goog.events.ListenableKey>| Parameters |
|---|
|
| Returns |
|
code »getTypeCount ( ) ⇒ number
number| Returns |
|---|
|
code »hasListener ( opt_type, opt_capture ) ⇒ booleanWhether there is a matching listener. If either the type or capture
parameters are unspecified, the function will match on the
remaining criteria.
boolean| Parameters |
|---|
|
| Returns |
|
Removes a matching listener.
| Parameters |
|---|
|
| Returns |
|
Removes all listeners from this map. If opt_type is provided, only
listeners that match the given type are removed.
| Parameters |
|---|
|
| Returns |
|
code »removeByKey ( listener ) ⇒ booleanRemoves the given listener object.
boolean| Parameters |
|---|
|
| Returns |
|
Instance Properties
code »src : (EventTarget|goog.events.Listenable)
(EventTarget|goog.events.Listenable)The count of types in this map that have registered listeners.
Static Functions
code »goog.events.ListenerMap.findListenerIndex_ ( listenerArray, listener, opt_useCapture, opt_listenerScope ) ⇒ numberFinds the index of a matching goog.events.Listener in the given
listenerArray.
number