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

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

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files 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/yaml/deep_equals.dart ('k') | utils/pub/yaml/visitor.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 // This file contains the node classes for the internal representations of YAML 5 // This file contains the node classes for the internal representations of YAML
6 // documents. These nodes are used for both the serialization tree and the 6 // documents. These nodes are used for both the serialization tree and the
7 // representation graph. 7 // representation graph.
8 8
9 /** A tag that indicates the type of a YAML node. */ 9 /** A tag that indicates the type of a YAML node. */
10 class _Tag { 10 class _Tag {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 Map<_Node, _Node> content; 212 Map<_Node, _Node> content;
213 213
214 _MappingNode(String tagName, this.content) 214 _MappingNode(String tagName, this.content)
215 : super(new _Tag.mapping(tagName)); 215 : super(new _Tag.mapping(tagName));
216 216
217 /** Two mappings are equal if their tags and contents are equal. */ 217 /** Two mappings are equal if their tags and contents are equal. */
218 bool operator ==(other) { 218 bool operator ==(other) {
219 // Should be super != other; bug 2554 219 // Should be super != other; bug 2554
220 if (!(super == other) || other is! _MappingNode) return false; 220 if (!(super == other) || other is! _MappingNode) return false;
221 if (content.length != other.content.length) return false; 221 if (content.length != other.content.length) return false;
222 for (var key in content.getKeys()) { 222 for (var key in content.keys) {
223 if (!other.content.containsKey(key)) return false; 223 if (!other.content.containsKey(key)) return false;
224 if (content[key] != other.content[key]) return false; 224 if (content[key] != other.content[key]) return false;
225 } 225 }
226 return true; 226 return true;
227 } 227 }
228 228
229 String toString() { 229 String toString() {
230 var strContent = Strings.join(content.getKeys(). 230 var strContent = Strings.join(content.keys.
231 map((k) => '${k}: ${content[k]}'), ', '); 231 map((k) => '${k}: ${content[k]}'), ', ');
232 return '$tag {$strContent}'; 232 return '$tag {$strContent}';
233 } 233 }
234 234
235 int get hashCode => super.hashCode ^ _hashCode(content); 235 int get hashCode => super.hashCode ^ _hashCode(content);
236 236
237 visit(_Visitor v) => v.visitMapping(this); 237 visit(_Visitor v) => v.visitMapping(this);
238 } 238 }
OLDNEW
« no previous file with comments | « utils/pub/yaml/deep_equals.dart ('k') | utils/pub/yaml/visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698