lib/goog/disposable/idisposable.js

1// Copyright 2011 The Closure Library Authors. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS-IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/**
16 * @fileoverview Definition of the disposable interface. A disposable object
17 * has a dispose method to to clean up references and resources.
18 * @author nnaze@google.com (Nathan Naze)
19 */
20
21
22goog.provide('goog.disposable.IDisposable');
23
24
25
26/**
27 * Interface for a disposable object. If a instance requires cleanup
28 * (references COM objects, DOM notes, or other disposable objects), it should
29 * implement this interface (it may subclass goog.Disposable).
30 * @interface
31 */
32goog.disposable.IDisposable = function() {};
33
34
35/**
36 * Disposes of the object and its resources.
37 * @return {void} Nothing.
38 */
39goog.disposable.IDisposable.prototype.dispose = goog.abstractMethod;
40
41
42/**
43 * @return {boolean} Whether the object has been disposed of.
44 */
45goog.disposable.IDisposable.prototype.isDisposed = goog.abstractMethod;