goog.events.ListenerMap
Provided By |
---|
Creates a new listener map.
new ListenerMap( src )
Parameters |
|
---|
Instance Methods
this.add( type, listener, callOnce, opt_useCapture, opt_listenerScope ) → goog.events.ListenableKey
goog.events.ListenableKey
Adds 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.
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.getListener( type, listener, capture, opt_listenerScope ) → (goog.events.ListenableKey|null)
(goog.events.ListenableKey|null)
Gets the goog.events.ListenableKey for the event or null if no such listener is in use.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.getListenerCount() → number
number
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.getListeners( type, capture ) → Array<goog.events.ListenableKey>
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).
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.getTypeCount() → number
number
Parameters | None. | ||
---|---|---|---|
Returns |
|
this.hasListener( opt_type, opt_capture ) → boolean
boolean
Whether there is a matching listener. If either the type or capture parameters are unspecified, the function will match on the remaining criteria.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.remove( type, listener, opt_useCapture, opt_listenerScope ) → boolean
boolean
Removes a matching listener.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
this.removeAll( opt_type ) → number
number
Removes all listeners from this map. If opt_type is provided, only listeners that match the given type are removed.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
this.removeByKey( listener ) → boolean
boolean
Removes the given listener object.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
Instance Properties
this.listeners → Object<string, Array<goog.events.Listener>>
Object<string, Array<goog.events.Listener>>
Maps of event type to an array of listeners.
this.src → (EventTarget|goog.events.Listenable|null)
(EventTarget|goog.events.Listenable|null)
No information.