Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: sdk/lib/core/list.dart

Issue 12041019: Remove List.filled constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove List.filled usage in serialization package. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 */
11 abstract class List<E> implements Collection<E> { 11 abstract class List<E> implements Collection<E> {
12 /** 12 /**
13 * Creates a list of the given [length]. 13 * Creates a list of the given [length].
14 * 14 *
15 * The length of the returned list is not fixed. 15 * The length of the returned list is not fixed.
16 */ 16 */
17 external factory List([int length = 0]); 17 external factory List([int length = 0]);
18 18
19 /** 19 /**
20 * Creates a fixed-sized list of the given [length] where each entry is 20 * Creates a fixed-sized list of the given [length] where each entry is
21 * filled with [fill]. 21 * filled with [fill].
22 */ 22 */
23 external factory List.fixedLength(int length, {E fill: null}); 23 external factory List.fixedLength(int length, {E fill: null});
24 24
25 /** 25 /**
26 * Creates an list of the given [length] where each entry is
27 * filled with [fill].
28 *
29 * The length of the returned list is not fixed.
30 */
31 external factory List.filled(int length, E fill);
32
33 /**
34 * Creates an list with the elements of [other]. The order in 26 * Creates an list with the elements of [other]. The order in
35 * the list will be the order provided by the iterator of [other]. 27 * the list will be the order provided by the iterator of [other].
36 * 28 *
37 * The length of the returned list is not fixed. 29 * The length of the returned list is not fixed.
38 */ 30 */
39 factory List.from(Iterable other) { 31 factory List.from(Iterable other) {
40 var list = new List<E>(); 32 var list = new List<E>();
41 for (E e in other) { 33 for (E e in other) {
42 list.add(e); 34 list.add(e);
43 } 35 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 /** 216 /**
225 * Returns an unmodifiable [List] with at most [n] elements. 217 * Returns an unmodifiable [List] with at most [n] elements.
226 * 218 *
227 * The returned list is a view backed by this. 219 * The returned list is a view backed by this.
228 * 220 *
229 * The returned [List] may contain fewer than [n] elements, while [:this:] 221 * The returned [List] may contain fewer than [n] elements, while [:this:]
230 * contains fewer than [n] elements. 222 * contains fewer than [n] elements.
231 */ 223 */
232 List<E> take(int n); 224 List<E> take(int n);
233 } 225 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/core_patch.dart ('k') | tests/corelib/list_growable_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698