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 at
6 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * 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 and
12 * limitations under the License.
16 * @fileoverview Collection of multiple objects with useful accessors.
18 * May also represent subset of a larger collection (i.e. page 1 of 10), and
19 * contain information about the larger collection.
25 * Collection of multiple objects with useful accessors.
26 * May also represent subset of a larger collection
27 * (for example, page 1 of 10)
28 * and contain information about the larger collection.
30 * @name opensocial.Collection
35 * Create a collection.
40 opensocial.Collection = function() {};
44 * Finds the entry with the given ID value, or returns null if none is found.
45 * @param {String} id The ID to look for
46 * @return {Object?} The data
48 opensocial.Collection.prototype.getById = function(id) {};
52 * Gets the size of this collection,
53 * which is equal to or less than the
54 * total size of the result.
55 * @return {Number} The size of this collection
57 opensocial.Collection.prototype.size = function() {};
61 * Executes the provided function once per member of the collection,
62 * with each member in turn as the
63 * parameter to the function.
64 * @param {Function} fn The function to call with each collection entry
66 opensocial.Collection.prototype.each = function(fn) {};
70 * Returns an array of all the objects in this collection.
71 * @return {Array.<Object>} The values in this collection
73 opensocial.Collection.prototype.asArray = function() {};
77 * Gets the total size of the larger result set
78 * that this collection belongs to.
79 * @return {Number} The total size of the result
81 opensocial.Collection.prototype.getTotalSize = function() {};
85 * Gets the offset of this collection within a larger result set.
86 * @return {Number} The offset into the total collection
88 opensocial.Collection.prototype.getOffset = function() {};