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

Side by Side Diff: lib/observe/list.dart

Issue 50433010: WebUI fixes for SDK 0.8.10 (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 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
« no previous file with comments | « no previous file | lib/observe/set.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library web_ui.observe.list; 5 library web_ui.observe.list;
6 6
7 import 'dart:collection';
8
7 import 'observable.dart'; 9 import 'observable.dart';
8 import 'package:web_ui/src/utils_observe.dart' show Arrays, ListMixinWorkaround; 10 import 'package:web_ui/src/utils_observe.dart' show Arrays;
9 11
10 /** 12 /**
11 * Represents an observable list of model values. If any items are added, 13 * Represents an observable list of model values. If any items are added,
12 * removed, or replaced, then observers that are registered with 14 * removed, or replaced, then observers that are registered with
13 * [observe] will be notified. 15 * [observe] will be notified.
14 */ 16 */
15 class ObservableList<E> extends ListMixinWorkaround with Observable 17 class ObservableList<E> extends ListBase<E> with Observable {
16 implements List<E> {
17 18
18 /** The inner [List<E>] with the actual storage. */ 19 /** The inner [List<E>] with the actual storage. */
19 final List<E> _list; 20 final List<E> _list;
20 21
21 /** 22 /**
22 * Creates an observable list of the given [length]. 23 * Creates an observable list of the given [length].
23 * 24 *
24 * If no [length] argument is supplied an extendable list of 25 * If no [length] argument is supplied an extendable list of
25 * length 0 is created. 26 * length 0 is created.
26 * 27 *
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 157
157 String toString() { 158 String toString() {
158 if (observeReads) { 159 if (observeReads) {
159 for (int i = 0; i < length; i++) { 160 for (int i = 0; i < length; i++) {
160 notifyRead(this, ChangeRecord.INDEX, i); 161 notifyRead(this, ChangeRecord.INDEX, i);
161 } 162 }
162 } 163 }
163 return _list.toString(); 164 return _list.toString();
164 } 165 }
165 } 166 }
OLDNEW
« no previous file with comments | « no previous file | lib/observe/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698