| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 */ | 111 */ |
| 112 E operator [](int index); | 112 E operator [](int index); |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * Sets the entry at the given [index] in the list to [value]. | 115 * Sets the entry at the given [index] in the list to [value]. |
| 116 * Throws an [RangeError] if [index] is out of bounds. | 116 * Throws an [RangeError] if [index] is out of bounds. |
| 117 */ | 117 */ |
| 118 void operator []=(int index, E value); | 118 void operator []=(int index, E value); |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * Returns the number of elements in the list. |
| 122 * |
| 123 * The valid indices for a list are 0 through `length - 1`. |
| 124 */ |
| 125 int get length; |
| 126 |
| 127 /** |
| 121 * Changes the length of the list. If [newLength] is greater than | 128 * Changes the length of the list. If [newLength] is greater than |
| 122 * the current [length], entries are initialized to [:null:]. Throws | 129 * the current [length], entries are initialized to [:null:]. Throws |
| 123 * an [UnsupportedError] if the list is not extendable. | 130 * an [UnsupportedError] if the list is not extendable. |
| 124 */ | 131 */ |
| 125 void set length(int newLength); | 132 void set length(int newLength); |
| 126 | 133 |
| 127 /** | 134 /** |
| 128 * Adds [value] at the end of the list, extending the length by | 135 * Adds [value] at the end of the list, extending the length by |
| 129 * one. Throws an [UnsupportedError] if the list is not | 136 * one. Throws an [UnsupportedError] if the list is not |
| 130 * extendable. | 137 * extendable. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 void insertRange(int start, int length, [E fill]); | 274 void insertRange(int start, int length, [E fill]); |
| 268 | 275 |
| 269 /** | 276 /** |
| 270 * Returns an unmodifiable [Map] view of `this`. | 277 * Returns an unmodifiable [Map] view of `this`. |
| 271 * | 278 * |
| 272 * It has the indices of this list as keys, and the corresponding elements | 279 * It has the indices of this list as keys, and the corresponding elements |
| 273 * as values. | 280 * as values. |
| 274 */ | 281 */ |
| 275 Map<int, E> asMap(); | 282 Map<int, E> asMap(); |
| 276 } | 283 } |
| OLD | NEW |