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

Side by Side Diff: sdk/lib/core/list.dart

Issue 25931003: Make List.shuffle take an optional Random object to use. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 2 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 | « sdk/lib/core/core.dart ('k') | sdk/lib/html/dart2js/html_dart2js.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) 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
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
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 }
OLDNEW
« no previous file with comments | « sdk/lib/core/core.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698