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

Side by Side Diff: pkg/serialization/lib/src/basic_rule.dart

Issue 12255055: Make Comparable generic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months 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 | « pkg/logging/lib/logging.dart ('k') | sdk/lib/collection/splay_tree.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 part of serialization; 5 part of serialization;
6 6
7 // TODO(alanknight): Figure out how to reasonably separate out the things 7 // TODO(alanknight): Figure out how to reasonably separate out the things
8 // that require reflection without making the API more awkward. Or if that is 8 // that require reflection without making the API more awkward. Or if that is
9 // in fact necessary. Maybe the tree-shaking will just remove it if unused. 9 // in fact necessary. Maybe the tree-shaking will just remove it if unused.
10 10
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // TODO(alanknight): This, and other places, rely on synchronous access to 264 // TODO(alanknight): This, and other places, rely on synchronous access to
265 // mirrors. Should be changed to use a synchronous API once one is available, 265 // mirrors. Should be changed to use a synchronous API once one is available,
266 // or to be async, but that would be extremely ugly. 266 // or to be async, but that would be extremely ugly.
267 _value(InstanceMirror mirror, _Field field) => field.valueIn(mirror); 267 _value(InstanceMirror mirror, _Field field) => field.valueIn(mirror);
268 } 268 }
269 269
270 /** 270 /**
271 * This represents a field in an object. It is intended to be used as part of 271 * This represents a field in an object. It is intended to be used as part of
272 * a [_FieldList]. 272 * a [_FieldList].
273 */ 273 */
274 abstract class _Field implements Comparable { 274 abstract class _Field implements Comparable<_Field> {
275 275
276 /** The FieldList that contains us. */ 276 /** The FieldList that contains us. */
277 final _FieldList fieldList; 277 final _FieldList fieldList;
278 278
279 /** 279 /**
280 * Our position in the [contents] collection of [fieldList]. This is used 280 * Our position in the [contents] collection of [fieldList]. This is used
281 * to index into the state, so it's extremely important. 281 * to index into the state, so it's extremely important.
282 */ 282 */
283 int index; 283 int index;
284 284
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 _MapWrapper(this.fieldList) : _map = new Map(); 623 _MapWrapper(this.fieldList) : _map = new Map();
624 _MapWrapper.fromMap(this._map, this.fieldList); 624 _MapWrapper.fromMap(this._map, this.fieldList);
625 625
626 operator [](key) => _map[fieldList[key].name]; 626 operator [](key) => _map[fieldList[key].name];
627 627
628 operator []=(key, value) { _map[fieldList[key].name] = value; } 628 operator []=(key, value) { _map[fieldList[key].name] = value; }
629 get length => _map.length; 629 get length => _map.length;
630 630
631 asMap() => _map; 631 asMap() => _map;
632 } 632 }
OLDNEW
« no previous file with comments | « pkg/logging/lib/logging.dart ('k') | sdk/lib/collection/splay_tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698