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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 /** | 234 /** |
| 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 [length] elements of [from], starting | 244 * Copies the elements of [from], starting |
| 245 * at [startFrom], into the list, starting at [start]. | 245 * at [startFrom], into the range [start] - [end] of `this`. |
| 246 * If [length] is 0, this method does not do anything. | 246 * |
| 247 * Throws an [ArgumentError] if [length] is negative. | 247 * If [start] equals [end], this method does not do anything. |
| 248 * Throws an [RangeError] if [start] or | 248 * |
| 249 * [:start + length - 1:] are out of range for [:this:], or if | 249 * It is an error if [start]..[end] is not a valid range pointing into the |
| 250 * [startFrom] or [:startFrom + length - 1:] are out of range for [from]. | 250 * `this`. |
| 251 * | |
| 252 * It is an error if [startFrom] does not point into [from], or if [from] | |
| 253 * does not have enough elements. | |
| 251 */ | 254 */ |
| 252 void setRange(int start, int length, List<E> from, [int startFrom]); | 255 void setRange(int start, int end, List<E> from, [int startFrom]); |
| 253 | 256 |
|
Sean Eagan
2013/04/11 14:22:07
I think there is a lot to be learned from C#'s set
Lasse Reichstein Nielsen
2013/04/11 14:33:51
I generally agree with Sean.
If the is not the eff
| |
| 254 /** | 257 /** |
| 255 * Removes [length] elements from the list, beginning at [start]. | 258 * Removes [length] elements from the list, beginning at [start]. |
| 256 * Throws an [UnsupportedError] if the list is | 259 * Throws an [UnsupportedError] if the list is |
| 257 * not extendable. | 260 * not extendable. |
| 258 * If [length] is 0, this method does not do anything. | 261 * If [length] is 0, this method does not do anything. |
| 259 * Throws an [ArgumentError] if [length] is negative. | 262 * Throws an [ArgumentError] if [length] is negative. |
| 260 * Throws an [RangeError] if [start] or | 263 * Throws an [RangeError] if [start] or |
| 261 * [:start + length: - 1] are out of range. | 264 * [:start + length: - 1] are out of range. |
| 262 */ | 265 */ |
| 263 void removeRange(int start, int length); | 266 void removeRange(int start, int length); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 277 void insertRange(int start, int length, [E fill]); | 280 void insertRange(int start, int length, [E fill]); |
| 278 | 281 |
| 279 /** | 282 /** |
| 280 * Returns an unmodifiable [Map] view of `this`. | 283 * Returns an unmodifiable [Map] view of `this`. |
| 281 * | 284 * |
| 282 * It has the indices of this list as keys, and the corresponding elements | 285 * It has the indices of this list as keys, and the corresponding elements |
| 283 * as values. | 286 * as values. |
| 284 */ | 287 */ |
| 285 Map<int, E> asMap(); | 288 Map<int, E> asMap(); |
| 286 } | 289 } |
| OLD | NEW |