| OLD | NEW |
| 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 _LazyMap(this._raw, this._reader); | 522 _LazyMap(this._raw, this._reader); |
| 523 | 523 |
| 524 final Map _raw; | 524 final Map _raw; |
| 525 final Reader _reader; | 525 final Reader _reader; |
| 526 | 526 |
| 527 // This is the only operation that really matters. | 527 // This is the only operation that really matters. |
| 528 operator [](x) => _reader.inflateReference(_raw[x]); | 528 operator [](x) => _reader.inflateReference(_raw[x]); |
| 529 | 529 |
| 530 int get length => _raw.length; | 530 int get length => _raw.length; |
| 531 bool get isEmpty => _raw.isEmpty; | 531 bool get isEmpty => _raw.isEmpty; |
| 532 bool get isNotEmpty => _raw.isNotEmpty; |
| 532 Iterable get keys => _raw.keys; | 533 Iterable get keys => _raw.keys; |
| 533 bool containsKey(x) => _raw.containsKey(x); | 534 bool containsKey(x) => _raw.containsKey(x); |
| 534 | 535 |
| 535 // These operations will work, but may be expensive, and are probably | 536 // These operations will work, but may be expensive, and are probably |
| 536 // best avoided. | 537 // best avoided. |
| 537 get _inflated => keysAndValues(_raw).map(_reader.inflateReference); | 538 get _inflated => keysAndValues(_raw).map(_reader.inflateReference); |
| 538 bool containsValue(x) => _inflated.containsValue(x); | 539 bool containsValue(x) => _inflated.containsValue(x); |
| 539 Iterable get values => _inflated.values; | 540 Iterable get values => _inflated.values; |
| 540 void forEach(f) => _inflated.forEach(f); | 541 void forEach(f) => _inflated.forEach(f); |
| 541 | 542 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 removeWhere(x) => _throw(); | 602 removeWhere(x) => _throw(); |
| 602 retainWhere(x) => _throw(); | 603 retainWhere(x) => _throw(); |
| 603 replaceRange(x, y, z) => _throw(); | 604 replaceRange(x, y, z) => _throw(); |
| 604 getRange(x, y) => _throw(); | 605 getRange(x, y) => _throw(); |
| 605 setRange(x, y, z, [a = 0]) => _throw(); | 606 setRange(x, y, z, [a = 0]) => _throw(); |
| 606 setAll(x, y) => _throw(); | 607 setAll(x, y) => _throw(); |
| 607 removeRange(x, y) => _throw(); | 608 removeRange(x, y) => _throw(); |
| 608 get reversed => _throw(); | 609 get reversed => _throw(); |
| 609 void set length(x) => _throw(); | 610 void set length(x) => _throw(); |
| 610 } | 611 } |
| OLD | NEW |