| 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 dart.collection; | 5 part of dart.collection; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * This class provides default implementations for Iterables (including Lists). | 8 * This class provides default implementations for Iterables (including Lists). |
| 9 * | 9 * |
| 10 * Once Dart receives Mixins it will be replaced with mixin classes. | 10 * Once Dart receives Mixins it will be replaced with mixin classes. |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 static List skipList(List list, int n) { | 330 static List skipList(List list, int n) { |
| 331 // The generic type is currently lost. It will be fixed with mixins. | 331 // The generic type is currently lost. It will be fixed with mixins. |
| 332 return new ListView(list, n, null); | 332 return new ListView(list, n, null); |
| 333 } | 333 } |
| 334 | 334 |
| 335 static Iterable skipWhile(Iterable iterable, bool test(var value)) { | 335 static Iterable skipWhile(Iterable iterable, bool test(var value)) { |
| 336 // The generic type is currently lost. It will be fixed with mixins. | 336 // The generic type is currently lost. It will be fixed with mixins. |
| 337 return new SkipWhileIterable(iterable, test); | 337 return new SkipWhileIterable(iterable, test); |
| 338 } | 338 } |
| 339 | 339 |
| 340 static List reversedList(List l) { |
| 341 return new ReversedListView(l, 0, null); |
| 342 } |
| 343 |
| 340 static void sortList(List l, int compare(a, b)) { | 344 static void sortList(List l, int compare(a, b)) { |
| 341 if (compare == null) compare = Comparable.compare; | 345 if (compare == null) compare = Comparable.compare; |
| 342 Sort.sort(l, compare); | 346 Sort.sort(l, compare); |
| 343 } | 347 } |
| 344 } | 348 } |
| 345 | 349 |
| 346 /** | 350 /** |
| 347 * The [Collections] class implements static methods useful when | 351 * The [Collections] class implements static methods useful when |
| 348 * writing a class that implements [Collection] and the [iterator] | 352 * writing a class that implements [Collection] and the [iterator] |
| 349 * method. | 353 * method. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 static List skipList(List list, int n) | 454 static List skipList(List list, int n) |
| 451 => IterableMixinWorkaround.skipList(list, n); | 455 => IterableMixinWorkaround.skipList(list, n); |
| 452 | 456 |
| 453 /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ | 457 /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ |
| 454 static Iterable skipWhile(Iterable iterable, bool test(var value)) | 458 static Iterable skipWhile(Iterable iterable, bool test(var value)) |
| 455 => IterableMixinWorkaround.skipWhile(iterable, test); | 459 => IterableMixinWorkaround.skipWhile(iterable, test); |
| 456 | 460 |
| 457 static String collectionToString(Collection c) | 461 static String collectionToString(Collection c) |
| 458 => ToString.collectionToString(c); | 462 => ToString.collectionToString(c); |
| 459 } | 463 } |
| OLD | NEW |