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. It can be of | 8 * A [List] is an indexable collection with a length. It can be of |
9 * fixed size or extendable. | 9 * fixed size or extendable. |
10 */ | 10 */ |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void addLast(E value); | 70 void addLast(E value); |
71 | 71 |
72 /** | 72 /** |
73 * Appends all elements of the [iterable] to the end of this list. | 73 * Appends all elements of the [iterable] to the end of this list. |
74 * Extends the length of the list by the number of elements in [iterable]. | 74 * Extends the length of the list by the number of elements in [iterable]. |
75 * Throws an [UnsupportedError] if this list is not extensible. | 75 * Throws an [UnsupportedError] if this list is not extensible. |
76 */ | 76 */ |
77 void addAll(Iterable<E> iterable); | 77 void addAll(Iterable<E> iterable); |
78 | 78 |
79 /** | 79 /** |
80 * Returns an [Iterable] of the elements of this [List] in reverse order. | 80 * Returns a reversed fixed-length view of this [List]. |
| 81 * |
| 82 * The reversed list has elements in the opposite order of this list. |
| 83 * It is backed by this list, but will stop working if this list |
| 84 * becomes shorter than its current length. |
81 */ | 85 */ |
82 Iterable<E> get reversed; | 86 List<E> get reversed; |
83 | 87 |
84 /** | 88 /** |
85 * Sorts the list according to the order specified by the [compare] function. | 89 * Sorts the list according to the order specified by the [compare] function. |
86 * | 90 * |
87 * The [compare] function must act as a [Comparator]. | 91 * The [compare] function must act as a [Comparator]. |
88 * The default [List] implementations use [Comparable.compare] if | 92 * The default [List] implementations use [Comparable.compare] if |
89 * [compare] is omitted. | 93 * [compare] is omitted. |
90 */ | 94 */ |
91 void sort([int compare(E a, E b)]); | 95 void sort([int compare(E a, E b)]); |
92 | 96 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 * not extendable. | 184 * not extendable. |
181 * If [length] is 0, this method does not do anything. | 185 * If [length] is 0, this method does not do anything. |
182 * If [start] is the length of the list, this method inserts the | 186 * If [start] is the length of the list, this method inserts the |
183 * range at the end of the list. | 187 * range at the end of the list. |
184 * Throws an [ArgumentError] if [length] is negative. | 188 * Throws an [ArgumentError] if [length] is negative. |
185 * Throws an [RangeError] if [start] is negative or if | 189 * Throws an [RangeError] if [start] is negative or if |
186 * [start] is greater than the length of the list. | 190 * [start] is greater than the length of the list. |
187 */ | 191 */ |
188 void insertRange(int start, int length, [E fill]); | 192 void insertRange(int start, int length, [E fill]); |
189 } | 193 } |
OLD | NEW |