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 * An indexable collection of objects with a length. | 8 * An indexable collection of objects with a length. |
9 * | 9 * |
10 * Subclasses of this class implement different kinds of lists. | 10 * Subclasses of this class implement different kinds of lists. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 int get length; | 152 int get length; |
153 | 153 |
154 /** | 154 /** |
155 * Changes the length of this list. | 155 * Changes the length of this list. |
156 * | 156 * |
157 * If [newLength] is greater than | 157 * If [newLength] is greater than |
158 * the current length, entries are initialized to [:null:]. | 158 * the current length, entries are initialized to [:null:]. |
159 * | 159 * |
160 * Throws an [UnsupportedError] if the list is fixed-length. | 160 * Throws an [UnsupportedError] if the list is fixed-length. |
161 */ | 161 */ |
162 set length(int newLength); | 162 void set length(int newLength); |
163 | 163 |
164 /** | 164 /** |
165 * Adds [value] to the end of this list, | 165 * Adds [value] to the end of this list, |
166 * extending the length by one. | 166 * extending the length by one. |
167 * | 167 * |
168 * Throws an [UnsupportedError] if the list is fixed-length. | 168 * Throws an [UnsupportedError] if the list is fixed-length. |
169 */ | 169 */ |
170 void add(E value); | 170 void add(E value); |
171 | 171 |
172 /** | 172 /** |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 * as values. The `Map.keys` [Iterable] iterates the indices of this list | 466 * as values. The `Map.keys` [Iterable] iterates the indices of this list |
467 * in numerical order. | 467 * in numerical order. |
468 * | 468 * |
469 * List<String> words = ['fee', 'fi', 'fo', 'fum']; | 469 * List<String> words = ['fee', 'fi', 'fo', 'fum']; |
470 * Map<int, String> map = words.asMap(); | 470 * Map<int, String> map = words.asMap(); |
471 * map[0] + map[1]; // 'feefi'; | 471 * map[0] + map[1]; // 'feefi'; |
472 * map.keys.toList(); // [0, 1, 2, 3] | 472 * map.keys.toList(); // [0, 1, 2, 3] |
473 */ | 473 */ |
474 Map<int, E> asMap(); | 474 Map<int, E> asMap(); |
475 } | 475 } |
OLD | NEW |