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

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

Issue 13945009: Make default argument to Iterable.join be "". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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
« no previous file with comments | « sdk/lib/collection/list.dart ('k') | sdk/lib/core/string_buffer.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) 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 * The [Iterable] interface allows to get an [Iterator] out of an 8 * The [Iterable] interface allows to get an [Iterator] out of an
9 * [Iterable] object. 9 * [Iterable] object.
10 * 10 *
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return true; 139 return true;
140 } 140 }
141 141
142 /** 142 /**
143 * Convert each element to a [String] and concatenate the strings. 143 * Convert each element to a [String] and concatenate the strings.
144 * 144 *
145 * Converts each element to a [String] by calling [Object.toString] on it. 145 * Converts each element to a [String] by calling [Object.toString] on it.
146 * Then concatenates the strings, optionally separated by the [separator] 146 * Then concatenates the strings, optionally separated by the [separator]
147 * string. 147 * string.
148 */ 148 */
149 String join([String separator]) { 149 String join([String separator = ""]) {
150 StringBuffer buffer = new StringBuffer(); 150 StringBuffer buffer = new StringBuffer();
151 buffer.writeAll(this, separator == null ? "" : separator); 151 buffer.writeAll(this, separator);
152 return buffer.toString(); 152 return buffer.toString();
153 } 153 }
154 154
155 /** 155 /**
156 * Returns true if one element of this collection satisfies the 156 * Returns true if one element of this collection satisfies the
157 * predicate [f]. Returns false otherwise. 157 * predicate [f]. Returns false otherwise.
158 */ 158 */
159 bool any(bool f(E element)) { 159 bool any(bool f(E element)) {
160 for (E element in this) { 160 for (E element in this) {
161 if (f(element)) return true; 161 if (f(element)) return true;
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 */ 446 */
447 abstract class BidirectionalIterator<T> extends Iterator<T> { 447 abstract class BidirectionalIterator<T> extends Iterator<T> {
448 /** 448 /**
449 * Move back to the previous element. 449 * Move back to the previous element.
450 * 450 *
451 * Returns true and updates [current] if successful. Returns false 451 * Returns true and updates [current] if successful. Returns false
452 * and sets [current] to null if there is no previous element. 452 * and sets [current] to null if there is no previous element.
453 */ 453 */
454 bool movePrevious(); 454 bool movePrevious();
455 } 455 }
OLDNEW
« no previous file with comments | « sdk/lib/collection/list.dart ('k') | sdk/lib/core/string_buffer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698