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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 * Returns an [Iterable] that iterators over the elements in the range | 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 | 236 * [start] to [end] (exclusive). The result of this function is backed by |
237 * `this`. | 237 * `this`. |
238 * | 238 * |
239 * It is an error if [end] is before [start]. | 239 * It is an error if [end] is before [start]. |
240 */ | 240 */ |
241 Iterable<E> getRange(int start, int end); | 241 Iterable<E> getRange(int start, int end); |
242 | 242 |
243 /** | 243 /** |
244 * Copies the elements of [from], starting | 244 * Copies the elements of [from], starting |
245 * at [startFrom], into the range [start] - [end] of `this`. | 245 * at [startFrom], into the range [start] - [end] (excluding) of `this`. |
246 * | 246 * |
247 * If [start] equals [end], this method does not do anything. | 247 * If [start] equals [end], this method does not do anything. |
248 * | 248 * |
249 * It is an error if [start]..[end] is not a valid range pointing into the | 249 * It is an error if [start]..[end] is not a valid range pointing into the |
250 * `this`. | 250 * `this`. |
251 * | 251 * |
252 * It is an error if [startFrom] does not point into [from], or if [from] | 252 * It is an error if [startFrom] does not point into [from], or if [from] |
253 * does not have enough elements. | 253 * does not have enough elements. |
254 */ | 254 */ |
255 void setRange(int start, int end, List<E> from, [int startFrom]); | 255 void setRange(int start, int end, List<E> from, [int startFrom]); |
256 | 256 |
257 /** | 257 /** |
258 * Removes [length] elements from the list, beginning at [start]. | 258 * Removes the elements in the range [start]..[end] (excluding). |
259 * Throws an [UnsupportedError] if the list is | 259 * |
260 * not extendable. | 260 * It is an error if [start]..[end] is not a valid range pointing into the |
261 * If [length] is 0, this method does not do anything. | 261 * `this`. |
262 * Throws an [ArgumentError] if [length] is negative. | |
263 * Throws an [RangeError] if [start] or | |
264 * [:start + length: - 1] are out of range. | |
265 */ | 262 */ |
266 void removeRange(int start, int length); | 263 void removeRange(int start, int end); |
267 | 264 |
268 /** | 265 /** |
269 * Inserts a new range into the list, starting from [start] to | 266 * Inserts a new range into the list, starting from [start] to |
270 * [:start + length - 1:]. The entries are filled with [fill]. | 267 * [:start + length - 1:]. The entries are filled with [fill]. |
271 * Throws an [UnsupportedError] if the list is | 268 * Throws an [UnsupportedError] if the list is |
272 * not extendable. | 269 * not extendable. |
273 * If [length] is 0, this method does not do anything. | 270 * If [length] is 0, this method does not do anything. |
274 * If [start] is the length of the list, this method inserts the | 271 * If [start] is the length of the list, this method inserts the |
275 * range at the end of the list. | 272 * range at the end of the list. |
276 * Throws an [ArgumentError] if [length] is negative. | 273 * Throws an [ArgumentError] if [length] is negative. |
277 * Throws an [RangeError] if [start] is negative or if | 274 * Throws an [RangeError] if [start] is negative or if |
278 * [start] is greater than the length of the list. | 275 * [start] is greater than the length of the list. |
279 */ | 276 */ |
280 void insertRange(int start, int length, [E fill]); | 277 void insertRange(int start, int length, [E fill]); |
281 | 278 |
282 /** | 279 /** |
283 * Returns an unmodifiable [Map] view of `this`. | 280 * Returns an unmodifiable [Map] view of `this`. |
284 * | 281 * |
285 * 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 |
286 * as values. | 283 * as values. |
287 */ | 284 */ |
288 Map<int, E> asMap(); | 285 Map<int, E> asMap(); |
289 } | 286 } |
OLD | NEW |