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 class _GrowableObjectArray<T> implements List<T> { | 5 class _GrowableObjectArray<T> implements List<T> { |
6 factory _GrowableObjectArray._uninstantiable() { | 6 factory _GrowableObjectArray._uninstantiable() { |
7 throw new UnsupportedError( | 7 throw new UnsupportedError( |
8 "GrowableObjectArray can only be allocated by the VM"); | 8 "GrowableObjectArray can only be allocated by the VM"); |
9 } | 9 } |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 | 32 |
33 void removeAll(Iterable elements) { | 33 void removeAll(Iterable elements) { |
34 IterableMixinWorkaround.removeAllList(this, elements); | 34 IterableMixinWorkaround.removeAllList(this, elements); |
35 } | 35 } |
36 | 36 |
37 void retainAll(Iterable elements) { | 37 void retainAll(Iterable elements) { |
38 IterableMixinWorkaround.retainAll(this, elements); | 38 IterableMixinWorkaround.retainAll(this, elements); |
39 } | 39 } |
40 | 40 |
41 void removeMatching(bool test(T element)) { | 41 void removeWhere(bool test(T element)) { |
42 IterableMixinWorkaround.removeMatchingList(this, test); | 42 IterableMixinWorkaround.removeWhereList(this, test); |
43 } | 43 } |
44 | 44 |
45 void retainMatching(bool test(T element)) { | 45 void retainWhere(bool test(T element)) { |
46 IterableMixinWorkaround.removeMatchingList(this, | 46 IterableMixinWorkaround.removeWhereList(this, |
47 (T element) => !test(element)); | 47 (T element) => !test(element)); |
48 } | 48 } |
49 | 49 |
50 void setRange(int start, int length, List<T> from, [int startFrom = 0]) { | 50 void setRange(int start, int length, List<T> from, [int startFrom = 0]) { |
51 IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom); | 51 IterableMixinWorkaround.setRangeList(this, start, length, from, startFrom); |
52 } | 52 } |
53 | 53 |
54 void removeRange(int start, int length) { | 54 void removeRange(int start, int length) { |
55 if (length == 0) { | 55 if (length == 0) { |
56 return; | 56 return; |
57 } | 57 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 271 } |
272 | 272 |
273 bool every(bool f(T element)) { | 273 bool every(bool f(T element)) { |
274 return IterableMixinWorkaround.every(this, f); | 274 return IterableMixinWorkaround.every(this, f); |
275 } | 275 } |
276 | 276 |
277 bool any(bool f(T element)) { | 277 bool any(bool f(T element)) { |
278 return IterableMixinWorkaround.any(this, f); | 278 return IterableMixinWorkaround.any(this, f); |
279 } | 279 } |
280 | 280 |
281 T firstMatching(bool test(T value), {T orElse()}) { | 281 T firstWhere(bool test(T value), {T orElse()}) { |
282 return IterableMixinWorkaround.firstMatching(this, test, orElse); | 282 return IterableMixinWorkaround.firstWhere(this, test, orElse); |
283 } | 283 } |
284 | 284 |
285 T lastMatching(bool test(T value), {T orElse()}) { | 285 T lastWhere(bool test(T value), {T orElse()}) { |
286 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); | 286 return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
287 } | 287 } |
288 | 288 |
289 T singleMatching(bool test(T value)) { | 289 T singleWhere(bool test(T value)) { |
290 return IterableMixinWorkaround.singleMatching(this, test); | 290 return IterableMixinWorkaround.singleWhere(this, test); |
291 } | 291 } |
292 | 292 |
293 T elementAt(int index) { | 293 T elementAt(int index) { |
294 return this[index]; | 294 return this[index]; |
295 } | 295 } |
296 | 296 |
297 bool get isEmpty { | 297 bool get isEmpty { |
298 return this.length == 0; | 298 return this.length == 0; |
299 } | 299 } |
300 | 300 |
(...skipping 20 matching lines...) Expand all Loading... |
321 } | 321 } |
322 | 322 |
323 Set<T> toSet() { | 323 Set<T> toSet() { |
324 return new Set<T>.from(this); | 324 return new Set<T>.from(this); |
325 } | 325 } |
326 | 326 |
327 Map<int, T> asMap() { | 327 Map<int, T> asMap() { |
328 return IterableMixinWorkaround.asMapList(this); | 328 return IterableMixinWorkaround.asMapList(this); |
329 } | 329 } |
330 } | 330 } |
OLD | NEW |