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

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

Issue 14065011: Implement getRange (returning an Iterable). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes and status-file update. Created 7 years, 8 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
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 * A [List] is an indexable collection with a length. 8 * A [List] is an indexable collection with a length.
9 * 9 *
10 * A `List` implementation can choose not to support all methods 10 * A `List` implementation can choose not to support all methods
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 E removeAt(int index); 215 E removeAt(int index);
216 216
217 /** 217 /**
218 * Pops and returns the last element of the list. 218 * Pops and returns the last element of the list.
219 * Throws a [UnsupportedError] if the length of the 219 * Throws a [UnsupportedError] if the length of the
220 * list cannot be changed. 220 * list cannot be changed.
221 */ 221 */
222 E removeLast(); 222 E removeLast();
223 223
224 /** 224 /**
225 * Returns a new list containing the elemenst from [start] to [end]. 225 * Returns a new list containing the elements from [start] to [end].
226 * 226 *
227 * If [end] is omitted, the [length] of the list is used. 227 * If [end] is omitted, the [length] of the list is used.
228 * 228 *
229 * It is an error if [start] or [end] are not list indices for this list, 229 * It is an error if [start] or [end] are not list indices for this list,
230 * or if [end] is before [start]. 230 * or if [end] is before [start].
231 */ 231 */
232 List<E> sublist(int start, [int end]); 232 List<E> sublist(int start, [int end]);
233 233
234 /** 234 /**
235 * *Deprecated*. Use [sublist] instead. 235 * Returns an [Iterable] that iterators over the elements in the range
236 * [start] to [end] (exclusive). The result of this function is backed by
237 * `this`.
238 *
Lasse Reichstein Nielsen 2013/04/11 10:56:15 Say what happens if the length of `this` changes.
floitsch 2013/04/11 14:12:48 Done.
239 * It is an error if [end] is before [start].
236 */ 240 */
237 @deprecated 241 Iterable<E> getRange(int start, int end);
238 List<E> getRange(int start, int length);
239 242
240 /** 243 /**
241 * Copies [length] elements of [from], starting 244 * Copies [length] elements of [from], starting
242 * at [startFrom], into the list, starting at [start]. 245 * at [startFrom], into the list, starting at [start].
243 * If [length] is 0, this method does not do anything. 246 * If [length] is 0, this method does not do anything.
244 * Throws an [ArgumentError] if [length] is negative. 247 * Throws an [ArgumentError] if [length] is negative.
245 * Throws an [RangeError] if [start] or 248 * Throws an [RangeError] if [start] or
246 * [:start + length - 1:] are out of range for [:this:], or if 249 * [:start + length - 1:] are out of range for [:this:], or if
247 * [startFrom] or [:startFrom + length - 1:] are out of range for [from]. 250 * [startFrom] or [:startFrom + length - 1:] are out of range for [from].
248 */ 251 */
(...skipping 25 matching lines...) Expand all
274 void insertRange(int start, int length, [E fill]); 277 void insertRange(int start, int length, [E fill]);
275 278
276 /** 279 /**
277 * Returns an unmodifiable [Map] view of `this`. 280 * Returns an unmodifiable [Map] view of `this`.
278 * 281 *
279 * It has the indices of this list as keys, and the corresponding elements 282 * It has the indices of this list as keys, and the corresponding elements
280 * as values. 283 * as values.
281 */ 284 */
282 Map<int, E> asMap(); 285 Map<int, E> asMap();
283 } 286 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698