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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 * Throws an [UnsupportedError] if the list is | 191 * Throws an [UnsupportedError] if the list is |
192 * not extendable. | 192 * not extendable. |
193 * If [length] is 0, this method does not do anything. | 193 * If [length] is 0, this method does not do anything. |
194 * If [start] is the length of the list, this method inserts the | 194 * If [start] is the length of the list, this method inserts the |
195 * range at the end of the list. | 195 * range at the end of the list. |
196 * Throws an [ArgumentError] if [length] is negative. | 196 * Throws an [ArgumentError] if [length] is negative. |
197 * Throws an [RangeError] if [start] is negative or if | 197 * Throws an [RangeError] if [start] is negative or if |
198 * [start] is greater than the length of the list. | 198 * [start] is greater than the length of the list. |
199 */ | 199 */ |
200 void insertRange(int start, int length, [E fill]); | 200 void insertRange(int start, int length, [E fill]); |
201 | |
202 /** | |
203 * Returns a lazy unmodifiable [List] where each element [:e:] of [:this:] is | |
204 * replaced by the result of [:f(e):]. | |
205 * | |
206 * This method returns a view of the mapped elements. As long as the | |
207 * returned [List] is not indexed or iterated over, the supplied function [f] | |
208 * will not be invoked. The transformed elements will not be cached. Accessing | |
209 * elements multiple times will invoke the supplied function [f] multiple | |
210 * times. | |
211 */ | |
212 List mappedBy(f(E element)); | |
213 | |
214 /** | |
215 * Returns an unmodifiable [List] that hides the first [n] elements. | |
216 * | |
217 * The returned list is a view backed by [:this:]. | |
218 * | |
219 * While [:this:] has fewer than [n] elements, then the resulting [List] | |
220 * will be empty. | |
221 */ | |
222 List<E> skip(int n); | |
223 | |
224 /** | |
225 * Returns an unmodifiable [List] with at most [n] elements. | |
226 * | |
227 * The returned list is a view backed by this. | |
228 * | |
229 * The returned [List] may contain fewer than [n] elements, while [:this:] | |
230 * contains fewer than [n] elements. | |
231 */ | |
232 List<E> take(int n); | |
233 } | 201 } |
OLD | NEW |