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

Side by Side Diff: sdk/lib/collection/collections.dart

Issue 12259045: Add unmodifiable list view. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | sdk/lib/html/dart2js/html_dart2js.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.collection; 5 part of dart.collection;
6 6
7 /** 7 /**
8 * This class provides default implementations for Iterables (including Lists). 8 * This class provides default implementations for Iterables (including Lists).
9 * 9 *
10 * Once Dart receives Mixins it will be replaced with mixin classes. 10 * Once Dart receives Mixins it will be replaced with mixin classes.
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 => IterableMixinWorkaround.skipList(list, n); 493 => IterableMixinWorkaround.skipList(list, n);
494 494
495 /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/ 495 /** Deprecated. Use the same method in [IterableMixinWorkaround] instead.*/
496 @deprecated 496 @deprecated
497 static Iterable skipWhile(Iterable iterable, bool test(var value)) 497 static Iterable skipWhile(Iterable iterable, bool test(var value))
498 => IterableMixinWorkaround.skipWhile(iterable, test); 498 => IterableMixinWorkaround.skipWhile(iterable, test);
499 499
500 static String collectionToString(Collection c) 500 static String collectionToString(Collection c)
501 => ToString.collectionToString(c); 501 => ToString.collectionToString(c);
502 } 502 }
503
504 /**
505 * An unmodifiable [List] view of another List.
506 *
507 * The source of the elements may be a [List] or any [Iterable] with
508 * efficient [Iterable.length] and [Iterable.elementAt].
509 */
510 class UnmodifiableListView<E> extends UnmodifiableListBase<E> {
511 Iterable<E> _source;
512 /** Create an unmodifiable list backed by [source]. */
513 UnmodifiableListView(Iterable<E> source) : _source = source;
514 int get length => _source.length;
515 E operator[](int index) => _source.elementAt(index);
516 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698