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

Side by Side Diff: samples/swarm/swarm_ui_lib/observable/observable.dart

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use insertBefore and add is-check. Created 7 years, 9 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 | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/list.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 observable; 5 library observable;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 part 'ChangeEvent.dart'; 9 part 'ChangeEvent.dart';
10 part 'EventBatch.dart'; 10 part 'EventBatch.dart';
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return _internal.length; 191 return _internal.length;
192 } 192 }
193 193
194 T get first => _internal.first; 194 T get first => _internal.first;
195 T get last => _internal.last; 195 T get last => _internal.last;
196 T get single => _internal.single; 196 T get single => _internal.single;
197 197
198 T min([int compare(T a, T b)]) => _internal.min(compare); 198 T min([int compare(T a, T b)]) => _internal.min(compare);
199 T max([int compare(T a, T b)]) => _internal.max(compare); 199 T max([int compare(T a, T b)]) => _internal.max(compare);
200 200
201 void insert(int index, T element) {
202 _internal.insert(index, element);
203 recordListInsert(index, element);
204 }
205
201 T removeLast() { 206 T removeLast() {
202 final result = _internal.removeLast(); 207 final result = _internal.removeLast();
203 recordListRemove(length, result); 208 recordListRemove(length, result);
204 return result; 209 return result;
205 } 210 }
206 211
207 T removeAt(int index) { 212 T removeAt(int index) {
208 T result = _internal.removeAt(index); 213 T result = _internal.removeAt(index);
209 recordListRemove(index, result); 214 recordListRemove(index, result);
210 return result; 215 return result;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 // Only fire on an actual change. 335 // Only fire on an actual change.
331 if (!identical(newValue, _value)) { 336 if (!identical(newValue, _value)) {
332 final oldValue = _value; 337 final oldValue = _value;
333 _value = newValue; 338 _value = newValue;
334 recordPropertyUpdate("value", newValue, oldValue); 339 recordPropertyUpdate("value", newValue, oldValue);
335 } 340 }
336 } 341 }
337 342
338 T _value; 343 T _value;
339 } 344 }
OLDNEW
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698