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.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * An indexable collection of objects with a length. | 8 * An indexable collection of objects with a length. |
9 * | 9 * |
10 * Subclasses of this class implement different kinds of lists. | 10 * Subclasses of this class implement different kinds of lists. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 * | 177 * |
178 * List<int> nums = [13, 2, -11]; | 178 * List<int> nums = [13, 2, -11]; |
179 * nums.sort(); | 179 * nums.sort(); |
180 nums.join(', '); // '-11, 2, 13' | 180 nums.join(', '); // '-11, 2, 13' |
181 */ | 181 */ |
182 void sort([int compare(E a, E b)]); | 182 void sort([int compare(E a, E b)]); |
183 | 183 |
184 /** | 184 /** |
185 * Shuffles the elements of this list randomly. | 185 * Shuffles the elements of this list randomly. |
186 */ | 186 */ |
187 void shuffle(); | 187 void shuffle([Random random]); |
188 | 188 |
189 /** | 189 /** |
190 * Returns the first index of [element] in this list. | 190 * Returns the first index of [element] in this list. |
191 * | 191 * |
192 * Searches the list from index [start] to the end of the list. | 192 * Searches the list from index [start] to the end of the list. |
193 * The first time an object [:o:] is encountered so that [:o == element:], | 193 * The first time an object [:o:] is encountered so that [:o == element:], |
194 * the index of [:o:] is returned. | 194 * the index of [:o:] is returned. |
195 * | 195 * |
196 * List<String> notes = ['do', 're', 'mi', 're']; | 196 * List<String> notes = ['do', 're', 'mi', 're']; |
197 * notes.indexOf('re'); // 1 | 197 * notes.indexOf('re'); // 1 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 * as values. The `Map.keys` [Iterable] iterates the indices of this list | 429 * as values. The `Map.keys` [Iterable] iterates the indices of this list |
430 * in numerical order. | 430 * in numerical order. |
431 * | 431 * |
432 * List<String> words = ['fee', 'fi', 'fo', 'fum']; | 432 * List<String> words = ['fee', 'fi', 'fo', 'fum']; |
433 * Map<int, String> map = words.asMap(); | 433 * Map<int, String> map = words.asMap(); |
434 * map[0] + map[1]; // 'feefi'; | 434 * map[0] + map[1]; // 'feefi'; |
435 * map.keys.toList(); // [0, 1, 2, 3] | 435 * map.keys.toList(); // [0, 1, 2, 3] |
436 */ | 436 */ |
437 Map<int, E> asMap(); | 437 Map<int, E> asMap(); |
438 } | 438 } |
OLD | NEW |