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

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

Issue 14022007: Move Iterable implementation to collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Merge to head. 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/core/set.dart ('k') | sdk/lib/utf/utf.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 * The String class represents sequences of characters. Strings are 8 * The String class represents sequences of characters. Strings are
9 * immutable. A string is represented by a sequence of Unicode UTF-16 9 * immutable. A string is represented by a sequence of Unicode UTF-16
10 * code units accessible through the [codeUnitAt] or the 10 * code units accessible through the [codeUnitAt] or the
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 * If this string is not already all upper case, returns a new string 244 * If this string is not already all upper case, returns a new string
245 * where all characters are made upper case. Returns [:this:] otherwise. 245 * where all characters are made upper case. Returns [:this:] otherwise.
246 */ 246 */
247 // TODO(floitsch): document better. (See EcmaScript for description). 247 // TODO(floitsch): document better. (See EcmaScript for description).
248 String toUpperCase(); 248 String toUpperCase();
249 } 249 }
250 250
251 /** 251 /**
252 * The runes (integer Unicode code points) of a [String]. 252 * The runes (integer Unicode code points) of a [String].
253 */ 253 */
254 class Runes extends Iterable<int> { 254 class Runes extends IterableBase<int> {
255 final String string; 255 final String string;
256 Runes(this.string); 256 Runes(this.string);
257 257
258 RuneIterator get iterator => new RuneIterator(string); 258 RuneIterator get iterator => new RuneIterator(string);
259 259
260 int get last { 260 int get last {
261 if (string.length == 0) { 261 if (string.length == 0) {
262 throw new StateError("No elements."); 262 throw new StateError("No elements.");
263 } 263 }
264 int length = string.length; 264 int length = string.length;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 _position = position - 1; 439 _position = position - 1;
440 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); 440 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit);
441 return true; 441 return true;
442 } 442 }
443 } 443 }
444 _position = position; 444 _position = position;
445 _currentCodePoint = codeUnit; 445 _currentCodePoint = codeUnit;
446 return true; 446 return true;
447 } 447 }
448 } 448 }
OLDNEW
« no previous file with comments | « sdk/lib/core/set.dart ('k') | sdk/lib/utf/utf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698