Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: utils/pub/yaml/yaml_map.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/version_solver.dart ('k') | utils/template/codegen.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * This class wraps behaves almost identically to the normal Dart Map 6 * This class wraps behaves almost identically to the normal Dart Map
7 * implementation, with the following differences: 7 * implementation, with the following differences:
8 * 8 *
9 * * It allows null, NaN, boolean, list, and map keys. 9 * * It allows null, NaN, boolean, list, and map keys.
10 * * It defines `==` structurally. That is, `yamlMap1 == yamlMap2` if they have 10 * * It defines `==` structurally. That is, `yamlMap1 == yamlMap2` if they have
(...skipping 14 matching lines...) Expand all
25 operator [](key) => _map[_wrapKey(key)]; 25 operator [](key) => _map[_wrapKey(key)];
26 operator []=(key, value) { _map[_wrapKey(key)] = value; } 26 operator []=(key, value) { _map[_wrapKey(key)] = value; }
27 putIfAbsent(key, ifAbsent()) => _map.putIfAbsent(_wrapKey(key), ifAbsent); 27 putIfAbsent(key, ifAbsent()) => _map.putIfAbsent(_wrapKey(key), ifAbsent);
28 remove(key) => _map.remove(_wrapKey(key)); 28 remove(key) => _map.remove(_wrapKey(key));
29 void clear() => _map.clear(); 29 void clear() => _map.clear();
30 void forEach(void f(key, value)) => 30 void forEach(void f(key, value)) =>
31 _map.forEach((k, v) => f(_unwrapKey(k), v)); 31 _map.forEach((k, v) => f(_unwrapKey(k), v));
32 Collection getKeys() => _map.getKeys().map(_unwrapKey); 32 Collection getKeys() => _map.getKeys().map(_unwrapKey);
33 Collection getValues() => _map.getValues(); 33 Collection getValues() => _map.getValues();
34 int get length => _map.length; 34 int get length => _map.length;
35 bool isEmpty() => _map.isEmpty(); 35 bool get isEmpty => _map.isEmpty;
36 String toString() => _map.toString(); 36 String toString() => _map.toString();
37 37
38 int get hashCode => _hashCode(_map); 38 int get hashCode => _hashCode(_map);
39 39
40 bool operator ==(other) { 40 bool operator ==(other) {
41 if (other is! YamlMap) return false; 41 if (other is! YamlMap) return false;
42 return deepEquals(this, other); 42 return deepEquals(this, other);
43 } 43 }
44 44
45 /** Wraps an object for use as a key in the map. */ 45 /** Wraps an object for use as a key in the map. */
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 for (var e in obj) { 105 for (var e in obj) {
106 hash ^= _hashCode(e, parents); 106 hash ^= _hashCode(e, parents);
107 } 107 }
108 return hash; 108 return hash;
109 } 109 }
110 return obj.hashCode; 110 return obj.hashCode;
111 } finally { 111 } finally {
112 parents.removeLast(); 112 parents.removeLast();
113 } 113 }
114 } 114 }
OLDNEW
« no previous file with comments | « utils/pub/version_solver.dart ('k') | utils/template/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698