| 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 Defines the collection interface. |
| 17 | * |
| 18 | * @author nnaze@google.com (Nathan Naze) |
| 19 | */ |
| 20 | |
| 21 | goog.provide('goog.structs.Collection'); |
| 22 | |
| 23 | |
| 24 | |
| 25 | /** |
| 26 | * An interface for a collection of values. |
| 27 | * @interface |
| 28 | * @template T |
| 29 | */ |
| 30 | goog.structs.Collection = function() {}; |
| 31 | |
| 32 | |
| 33 | /** |
| 34 | * @param {T} value Value to add to the collection. |
| 35 | */ |
| 36 | goog.structs.Collection.prototype.add; |
| 37 | |
| 38 | |
| 39 | /** |
| 40 | * @param {T} value Value to remove from the collection. |
| 41 | */ |
| 42 | goog.structs.Collection.prototype.remove; |
| 43 | |
| 44 | |
| 45 | /** |
| 46 | * @param {T} value Value to find in the collection. |
| 47 | * @return {boolean} Whether the collection contains the specified value. |
| 48 | */ |
| 49 | goog.structs.Collection.prototype.contains; |
| 50 | |
| 51 | |
| 52 | /** |
| 53 | * @return {number} The number of values stored in the collection. |
| 54 | */ |
| 55 | goog.structs.Collection.prototype.getCount; |
| 56 | |