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

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

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head 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
« no previous file with comments | « samples/third_party/dromaeo/common/BenchUtil.dart ('k') | sdk/lib/_collection_dev/list.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._collection.dev; 5 part of dart._collection.dev;
6 6
7 /** 7 /**
8 * An [Iterable] for classes that have efficient [length] and [elementAt]. 8 * An [Iterable] for classes that have efficient [length] and [elementAt].
9 * 9 *
10 * All other methods are implemented in terms of [length] and [elementAt], 10 * All other methods are implemented in terms of [length] and [elementAt],
11 * including [iterator]. 11 * including [iterator].
12 */ 12 */
13 abstract class ListIterable<E> extends Iterable<E> { 13 abstract class ListIterable<E> extends Iterable<E> {
14 int get length; 14 int get length;
15 E elementAt(int i); 15 E elementAt(int i);
16 16
17 const ListIterable();
18
17 Iterator<E> get iterator => new ListIterator<E>(this); 19 Iterator<E> get iterator => new ListIterator<E>(this);
18 20
19 void forEach(void action(E element)) { 21 void forEach(void action(E element)) {
20 int length = this.length; 22 int length = this.length;
21 for (int i = 0; i < length; i++) { 23 for (int i = 0; i < length; i++) {
22 action(elementAt(i)); 24 action(elementAt(i));
23 if (length != this.length) { 25 if (length != this.length) {
24 throw new ConcurrentModificationError(this); 26 throw new ConcurrentModificationError(this);
25 } 27 }
26 } 28 }
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 class EmptyIterator<E> implements Iterator<E> { 685 class EmptyIterator<E> implements Iterator<E> {
684 const EmptyIterator(); 686 const EmptyIterator();
685 bool moveNext() => false; 687 bool moveNext() => false;
686 E get current => null; 688 E get current => null;
687 } 689 }
688 690
689 /** An [Iterator] that can move in both directions. */ 691 /** An [Iterator] that can move in both directions. */
690 abstract class BiDirectionalIterator<T> implements Iterator<T> { 692 abstract class BiDirectionalIterator<T> implements Iterator<T> {
691 bool movePrevious(); 693 bool movePrevious();
692 } 694 }
OLDNEW
« no previous file with comments | « samples/third_party/dromaeo/common/BenchUtil.dart ('k') | sdk/lib/_collection_dev/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698