Path: blob/trunk/third_party/closure/goog/events/eventid.js
2868 views
// Copyright 2013 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314goog.provide('goog.events.EventId');15161718/**19* A templated class that is used when registering for events. Typical usage:20*21* /** @type {goog.events.EventId<MyEventObj>} *\22* var myEventId = new goog.events.EventId(23* goog.events.getUniqueId(('someEvent'));24*25* // No need to cast or declare here since the compiler knows the26* // correct type of 'evt' (MyEventObj).27* something.listen(myEventId, function(evt) {});28*29* @param {string} eventId30* @template T31* @constructor32* @struct33* @final34*/35goog.events.EventId = function(eventId) {36/** @const */ this.id = eventId;37};383940/**41* @override42*/43goog.events.EventId.prototype.toString = function() {44return this.id;45};464748