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

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

Issue 1931633003: Fix Iterable.empty documentation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 collection of values, or "elements", that can be accessed sequentially. 8 * A collection of values, or "elements", that can be accessed sequentially.
9 * 9 *
10 * The elements of the iterable are accessed by getting an [Iterator] 10 * The elements of the iterable are accessed by getting an [Iterator]
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 factory Iterable.generate(int count, [E generator(int index)]) { 99 factory Iterable.generate(int count, [E generator(int index)]) {
100 if (count <= 0) return new EmptyIterable<E>(); 100 if (count <= 0) return new EmptyIterable<E>();
101 return new _GeneratorIterable<E>(count, generator); 101 return new _GeneratorIterable<E>(count, generator);
102 } 102 }
103 103
104 /** 104 /**
105 * Creates an empty iterable. 105 * Creates an empty iterable.
106 * 106 *
107 * The empty iterable has no elements, and iterating it always stops 107 * The empty iterable has no elements, and iterating it always stops
108 * immediately. 108 * immediately.
109 *
110 * An empty iterable can be used in places where you always that
111 * the iterable you would otherwise create is empty.
112 */ 109 */
113 const factory Iterable.empty() = EmptyIterable<E>; 110 const factory Iterable.empty() = EmptyIterable<E>;
114 111
115 /** 112 /**
116 * Returns a new `Iterator` that allows iterating the elements of this 113 * Returns a new `Iterator` that allows iterating the elements of this
117 * `Iterable`. 114 * `Iterable`.
118 * 115 *
119 * Iterable classes may specify the iteration order of their elements 116 * Iterable classes may specify the iteration order of their elements
120 * (for example [List] always iterate in index order), 117 * (for example [List] always iterate in index order),
121 * or they may leave it unspecified (for example a hash-based [Set] 118 * or they may leave it unspecified (for example a hash-based [Set]
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 */ 673 */
677 abstract class BidirectionalIterator<E> implements Iterator<E> { 674 abstract class BidirectionalIterator<E> implements Iterator<E> {
678 /** 675 /**
679 * Move back to the previous element. 676 * Move back to the previous element.
680 * 677 *
681 * Returns true and updates [current] if successful. Returns false 678 * Returns true and updates [current] if successful. Returns false
682 * and sets [current] to null if there is no previous element. 679 * and sets [current] to null if there is no previous element.
683 */ 680 */
684 bool movePrevious(); 681 bool movePrevious();
685 } 682 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698