| OLD | NEW |
| 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 Loading... |
| 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 insertAt(int index, T element) { |
| 202 _internal.insertAt(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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // Only fire on an actual change. | 319 // Only fire on an actual change. |
| 315 if (!identical(newValue, _value)) { | 320 if (!identical(newValue, _value)) { |
| 316 final oldValue = _value; | 321 final oldValue = _value; |
| 317 _value = newValue; | 322 _value = newValue; |
| 318 recordPropertyUpdate("value", newValue, oldValue); | 323 recordPropertyUpdate("value", newValue, oldValue); |
| 319 } | 324 } |
| 320 } | 325 } |
| 321 | 326 |
| 322 T _value; | 327 T _value; |
| 323 } | 328 } |
| OLD | NEW |