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

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

Issue 14022007: Move Iterable implementation to collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Merge to head. Created 7 years, 8 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/serialization/lib/src/basic_rule.dart ('k') | pkg/unittest/test/matchers_test.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): We should have an example and tests for subclassing 7 // TODO(alanknight): We should have an example and tests for subclassing
8 // serialization rule rather than using the hard-coded ClosureToMap rule. And 8 // serialization rule rather than using the hard-coded ClosureToMap rule. And
9 // possibly an abstract superclass that's designed to be subclassed that way. 9 // possibly an abstract superclass that's designed to be subclassed that way.
10 /** 10 /**
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 clear() => _throw(); 514 clear() => _throw();
515 } 515 }
516 516
517 /** 517 /**
518 * This provides an implementation of List that wraps a list which may 518 * This provides an implementation of List that wraps a list which may
519 * contain references to (potentially) non-inflated objects. If these 519 * contain references to (potentially) non-inflated objects. If these
520 * are accessed it will inflate them. This allows us to pass something that 520 * are accessed it will inflate them. This allows us to pass something that
521 * looks like it's just a list of objects to a [CustomRule] without needing 521 * looks like it's just a list of objects to a [CustomRule] without needing
522 * to inflate all the references in advance. 522 * to inflate all the references in advance.
523 */ 523 */
524 class _LazyList extends Iterable implements List { 524 class _LazyList extends IterableBase implements List {
525 _LazyList(this._raw, this._reader); 525 _LazyList(this._raw, this._reader);
526 526
527 final List _raw; 527 final List _raw;
528 final Reader _reader; 528 final Reader _reader;
529 529
530 // This is the only operation that really matters. 530 // This is the only operation that really matters.
531 operator [](x) => _reader.inflateReference(_raw[x]); 531 operator [](x) => _reader.inflateReference(_raw[x]);
532 532
533 int get length => _raw.length; 533 int get length => _raw.length;
534 bool get isEmpty => _raw.isEmpty; 534 bool get isEmpty => _raw.isEmpty;
(...skipping 28 matching lines...) Expand all
563 retainAll(x) => _throw(); 563 retainAll(x) => _throw();
564 removeWhere(x) => _throw(); 564 removeWhere(x) => _throw();
565 retainWhere(x) => _throw(); 565 retainWhere(x) => _throw();
566 getRange(x, y) => _throw(); 566 getRange(x, y) => _throw();
567 setRange(x, y, z, [a]) => _throw(); 567 setRange(x, y, z, [a]) => _throw();
568 removeRange(x, y) => _throw(); 568 removeRange(x, y) => _throw();
569 insertRange(x, y, [z]) => _throw(); 569 insertRange(x, y, [z]) => _throw();
570 get reversed => _throw(); 570 get reversed => _throw();
571 void set length(x) => _throw(); 571 void set length(x) => _throw();
572 } 572 }
OLDNEW
« no previous file with comments | « pkg/serialization/lib/src/basic_rule.dart ('k') | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698