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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 E removeAt(int index); | 218 E removeAt(int index); |
219 | 219 |
220 /** | 220 /** |
221 * Pops and returns the last element of the list. | 221 * Pops and returns the last element of the list. |
222 * Throws a [UnsupportedError] if the length of the | 222 * Throws a [UnsupportedError] if the length of the |
223 * list cannot be changed. | 223 * list cannot be changed. |
224 */ | 224 */ |
225 E removeLast(); | 225 E removeLast(); |
226 | 226 |
227 /** | 227 /** |
228 * Returns a new list containing [length] elements from the list, | 228 * Returns a new list containing the elemenst from [start] to [end]. |
229 * starting at [start]. | 229 * |
230 * Returns an empty list if [length] is 0. | 230 * If [end] is omitted, the [length] of the list is used. |
231 * Throws an [ArgumentError] if [length] is negative. | 231 * |
232 * Throws an [RangeError] if [start] or | 232 * It is an error if [start] or [end] are not list indices for this list, |
233 * [:start + length - 1:] are out of range. | 233 * or if [end] is before [start]. |
234 */ | 234 */ |
| 235 List<E> sublist(int start, [int end]); |
| 236 |
| 237 /** |
| 238 * *Deprecated*. Use [sublist] instead. |
| 239 */ |
| 240 @deprecated |
235 List<E> getRange(int start, int length); | 241 List<E> getRange(int start, int length); |
236 | 242 |
237 /** | 243 /** |
238 * Copies [length] elements of [from], starting | 244 * Copies [length] elements of [from], starting |
239 * at [startFrom], into the list, starting at [start]. | 245 * at [startFrom], into the list, starting at [start]. |
240 * If [length] is 0, this method does not do anything. | 246 * If [length] is 0, this method does not do anything. |
241 * Throws an [ArgumentError] if [length] is negative. | 247 * Throws an [ArgumentError] if [length] is negative. |
242 * Throws an [RangeError] if [start] or | 248 * Throws an [RangeError] if [start] or |
243 * [:start + length - 1:] are out of range for [:this:], or if | 249 * [:start + length - 1:] are out of range for [:this:], or if |
244 * [startFrom] or [:startFrom + length - 1:] are out of range for [from]. | 250 * [startFrom] or [:startFrom + length - 1:] are out of range for [from]. |
(...skipping 26 matching lines...) Expand all Loading... |
271 void insertRange(int start, int length, [E fill]); | 277 void insertRange(int start, int length, [E fill]); |
272 | 278 |
273 /** | 279 /** |
274 * Returns an unmodifiable [Map] view of `this`. | 280 * Returns an unmodifiable [Map] view of `this`. |
275 * | 281 * |
276 * 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 |
277 * as values. | 283 * as values. |
278 */ | 284 */ |
279 Map<int, E> asMap(); | 285 Map<int, E> asMap(); |
280 } | 286 } |
OLD | NEW |