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

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

Issue 1154263003: Revert "Make EfficientLength public, as EfficientLengthIterable." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « sdk/lib/core/iterable.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 * temporarily and is restored before continuing the iteration, the iterator 44 * temporarily and is restored before continuing the iteration, the iterator
45 * does not detect it. 45 * does not detect it.
46 * 46 *
47 * It is generally not allowed to modify the list's length (adding or removing 47 * It is generally not allowed to modify the list's length (adding or removing
48 * elements) while an operation on the list is being performed, 48 * elements) while an operation on the list is being performed,
49 * for example during a call to [forEach] or [sort]. 49 * for example during a call to [forEach] or [sort].
50 * Changing the list's length while it is being iterated, either by iterating it 50 * Changing the list's length while it is being iterated, either by iterating it
51 * directly or through iterating an [Iterable] that is backed by the list, will 51 * directly or through iterating an [Iterable] that is backed by the list, will
52 * break the iteration. 52 * break the iteration.
53 */ 53 */
54 abstract class List<E> implements EfficientLengthIterable<E> { 54 abstract class List<E> implements Iterable<E>, EfficientLength {
55 /** 55 /**
56 * Creates a list of the given length. 56 * Creates a list of the given length.
57 * 57 *
58 * The created list is fixed-length if [length] is provided. 58 * The created list is fixed-length if [length] is provided.
59 * 59 *
60 * List fixedLengthList = new List(3); 60 * List fixedLengthList = new List(3);
61 * fixedLengthList.length; // 3 61 * fixedLengthList.length; // 3
62 * fixedLengthList.length = 1; // Error 62 * fixedLengthList.length = 1; // Error
63 * 63 *
64 * The list has length 0 and is growable if [length] is omitted. 64 * The list has length 0 and is growable if [length] is omitted.
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « sdk/lib/core/iterable.dart ('k') | sdk/lib/core/set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698