Chromium Code Reviews| 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 * 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 E removeAt(int index); | 207 E removeAt(int index); |
| 208 | 208 |
| 209 /** | 209 /** |
| 210 * Pops and returns the last element of the list. | 210 * Pops and returns the last element of the list. |
| 211 * Throws a [UnsupportedError] if the length of the | 211 * Throws a [UnsupportedError] if the length of the |
| 212 * list cannot be changed. | 212 * list cannot be changed. |
| 213 */ | 213 */ |
| 214 E removeLast(); | 214 E removeLast(); |
| 215 | 215 |
| 216 /** | 216 /** |
| 217 * Returns a new list containing [length] elements from the list, | 217 * Returns a new list containing the elemenst from [start] to [end]. |
| 218 * starting at [start]. | 218 * |
| 219 * Returns an empty list if [length] is 0. | 219 * If [end] is omitted, the end of the list is used. |
|
floitsch
2013/03/14 15:46:06
length of the list ?
Lasse Reichstein Nielsen
2013/03/15 09:13:09
Done.
| |
| 220 * Throws an [ArgumentError] if [length] is negative. | 220 * |
| 221 * Throws an [RangeError] if [start] or | 221 * It is an error if [start] or [end] are not list indices for this list, |
| 222 * [:start + length - 1:] are out of range. | 222 * or if [end] is before [start]. |
| 223 */ | 223 */ |
| 224 List<E> sublist(int start, [int end]); | |
| 225 | |
| 226 /** | |
| 227 * *Deprecated*. Use [sublist] instead. | |
| 228 */ | |
| 229 @deprecated | |
| 224 List<E> getRange(int start, int length); | 230 List<E> getRange(int start, int length); |
| 225 | 231 |
| 226 /** | 232 /** |
| 227 * Copies [length] elements of [from], starting | 233 * Copies [length] elements of [from], starting |
| 228 * at [startFrom], into the list, starting at [start]. | 234 * at [startFrom], into the list, starting at [start]. |
| 229 * If [length] is 0, this method does not do anything. | 235 * If [length] is 0, this method does not do anything. |
| 230 * Throws an [ArgumentError] if [length] is negative. | 236 * Throws an [ArgumentError] if [length] is negative. |
| 231 * Throws an [RangeError] if [start] or | 237 * Throws an [RangeError] if [start] or |
| 232 * [:start + length - 1:] are out of range for [:this:], or if | 238 * [:start + length - 1:] are out of range for [:this:], or if |
| 233 * [startFrom] or [:startFrom + length - 1:] are out of range for [from]. | 239 * [startFrom] or [:startFrom + length - 1:] are out of range for [from]. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 260 void insertRange(int start, int length, [E fill]); | 266 void insertRange(int start, int length, [E fill]); |
| 261 | 267 |
| 262 /** | 268 /** |
| 263 * Returns an unmodifiable [Map] view of `this`. | 269 * Returns an unmodifiable [Map] view of `this`. |
| 264 * | 270 * |
| 265 * It has the indices of this list as keys, and the corresponding elements | 271 * It has the indices of this list as keys, and the corresponding elements |
| 266 * as values. | 272 * as values. |
| 267 */ | 273 */ |
| 268 Map<int, E> asMap(); | 274 Map<int, E> asMap(); |
| 269 } | 275 } |
| OLD | NEW |