Lines Matching refs:obj

25  * @param {Object.<K,V>} obj The object over which to iterate.
32 goog.object.forEach = function(obj, f, opt_obj) {
33 for (var key in obj) {
34 f.call(opt_obj, obj[key], key, obj);
43 * @param {Object.<K,V>} obj The object over which to iterate.
55 goog.object.filter = function(obj, f, opt_obj) {
57 for (var key in obj) {
58 if (f.call(opt_obj, obj[key], key, obj)) {
59 res[key] = obj[key];
70 * @param {Object.<K,V>} obj The object over which to iterate.
80 goog.object.map = function(obj, f, opt_obj) {
82 for (var key in obj) {
83 res[key] = f.call(opt_obj, obj[key], key, obj);
94 * @param {Object.<K,V>} obj The object to check.
103 goog.object.some = function(obj, f, opt_obj) {
104 for (var key in obj) {
105 if (f.call(opt_obj, obj[key], key, obj)) {
118 * @param {Object.<K,V>} obj The object to check.
127 goog.object.every = function(obj, f, opt_obj) {
128 for (var key in obj) {
129 if (!f.call(opt_obj, obj[key], key, obj)) {
140 * @param {Object} obj The object for which to get the number of key-value
144 goog.object.getCount = function(obj) {
149 for (var key in obj) {
161 * @param {Object} obj The object to pick a key from.
164 goog.object.getAnyKey = function(obj) {
165 for (var key in obj) {
176 * @param {Object.<K,V>} obj The object to pick a value from.
180 goog.object.getAnyValue = function(obj) {
181 for (var key in obj) {
182 return obj[key];
189 * An alias for goog.object.containsValue(obj, val).
191 * @param {Object.<K,V>} obj The object in which to look for val.
196 goog.object.contains = function(obj, val) {
197 return goog.object.containsValue(obj, val);
204 * @param {Object.<K,V>} obj The object from which to get the values.
208 goog.object.getValues = function(obj) {
211 for (var key in obj) {
212 res[i++] = obj[key];
221 * @param {Object} obj The object from which to get the keys.
224 goog.object.getKeys = function(obj) {
227 for (var key in obj) {
239 * @param {!Object} obj An object to get the value from. Can be array-like.
246 goog.object.getValueByKeys = function(obj, var_args) {
252 obj = obj[keys[i]];
253 if (!goog.isDef(obj)) {
258 return obj;
265 * @param {Object} obj The object in which to look for key.
269 goog.object.containsKey = function(obj, key) {
270 return key in obj;
277 * @param {Object.<K,V>} obj The object in which to look for val.
282 goog.object.containsValue = function(obj, val) {
283 for (var key in obj) {
284 if (obj[key] == val) {
295 * @param {Object.<K,V>} obj The object to search in.
304 goog.object.findKey = function(obj, f, opt_this) {
305 for (var key in obj) {
306 if (f.call(opt_this, obj[key], key, obj)) {
317 * @param {Object.<K,V>} obj The object to search in.
326 goog.object.findValue = function(obj, f, opt_this) {
327 var key = goog.object.findKey(obj, f, opt_this);
328 return key && obj[key];
335 * @param {Object} obj The object to test.
336 * @return {boolean} true if obj is empty.
338 goog.object.isEmpty = function(obj) {
339 for (var key in obj) {
349 * @param {Object} obj The object to clear.
351 goog.object.clear = function(obj) {
352 for (var i in obj) {
353 delete obj[i];
361 * @param {Object} obj The object from which to remove the key.
365 goog.object.remove = function(obj, key) {
367 if ((rv = key in obj)) {
368 delete obj[key];
378 * @param {Object.<K,V>} obj The object to which to add the key-value pair.
383 goog.object.add = function(obj, key, val) {
384 if (key in obj) {
387 goog.object.set(obj, key, val);
394 * @param {Object.<K,V>} obj The object from which to get the value.
401 goog.object.get = function(obj, key, opt_val) {
402 if (key in obj) {
403 return obj[key];
412 * @param {Object.<K,V>} obj The object to which to add the key-value pair.
417 goog.object.set = function(obj, key, value) {
418 obj[key] = value;
425 * @param {Object.<K,V>} obj The object to which to add the key-value pair.
431 goog.object.setIfUndefined = function(obj, key, value) {
432 return key in obj ? obj[key] : (obj[key] = value);
439 * @param {Object.<K,V>} obj Object to clone.
443 goog.object.clone = function(obj) {
448 for (var key in obj) {
449 res[key] = obj[key];
467 * @param {*} obj The value to clone.
470 goog.object.unsafeClone = function(obj) {
471 var type = goog.typeOf(obj);
473 if (obj.clone) {
474 return obj.clone();
477 for (var key in obj) {
478 clone[key] = goog.object.unsafeClone(obj[key]);
483 return obj;
492 * @param {Object} obj The object to transpose.
495 goog.object.transpose = function(obj) {
497 for (var key in obj) {
498 transposed[obj[key]] = key;
616 * @param {!Object.<K,V>} obj An object.
621 goog.object.createImmutableView = function(obj) {
622 var result = obj;
623 if (Object.isFrozen && !Object.isFrozen(obj)) {
624 result = Object.create(obj);
632 * @param {!Object} obj An object.
635 goog.object.isImmutableView = function(obj) {
636 return !!Object.isFrozen && Object.isFrozen(obj);