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

Side by Side Diff: sdk/lib/_collection_dev/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/_collection_dev/iterable.dart ('k') | sdk/lib/_internal/lib/interceptors.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.dev; 5 part of dart._collection.dev;
6 6
7 /** 7 /**
8 * Mixin that throws on the length changing operations of [List]. 8 * Mixin that throws on the length changing operations of [List].
9 * 9 *
10 * Intended to mix-in on top of [ListMixin] for fixed-length lists. 10 * Intended to mix-in on top of [ListMixin] for fixed-length lists.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void retainWhere(bool test(E element)) { 133 void retainWhere(bool test(E element)) {
134 throw new UnsupportedError( 134 throw new UnsupportedError(
135 "Cannot remove from an unmodifiable list"); 135 "Cannot remove from an unmodifiable list");
136 } 136 }
137 137
138 void sort([Comparator<E> compare]) { 138 void sort([Comparator<E> compare]) {
139 throw new UnsupportedError( 139 throw new UnsupportedError(
140 "Cannot modify an unmodifiable list"); 140 "Cannot modify an unmodifiable list");
141 } 141 }
142 142
143 void shuffle() { 143 void shuffle([Random random]) {
144 throw new UnsupportedError( 144 throw new UnsupportedError(
145 "Cannot modify an unmodifiable list"); 145 "Cannot modify an unmodifiable list");
146 } 146 }
147 147
148 void clear() { 148 void clear() {
149 throw new UnsupportedError( 149 throw new UnsupportedError(
150 "Cannot clear an unmodifiable list"); 150 "Cannot clear an unmodifiable list");
151 } 151 }
152 152
153 E removeAt(int index) { 153 E removeAt(int index) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 259 }
260 260
261 class ReversedListIterable<E> extends ListIterable<E> { 261 class ReversedListIterable<E> extends ListIterable<E> {
262 Iterable<E> _source; 262 Iterable<E> _source;
263 ReversedListIterable(this._source); 263 ReversedListIterable(this._source);
264 264
265 int get length => _source.length; 265 int get length => _source.length;
266 266
267 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); 267 E elementAt(int index) => _source.elementAt(_source.length - 1 - index);
268 } 268 }
OLDNEW
« no previous file with comments | « sdk/lib/_collection_dev/iterable.dart ('k') | sdk/lib/_internal/lib/interceptors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698