| Index: sdk/lib/collection/collections.dart
|
| diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart
|
| index 18c1d7b73c02e56818d2f213cffe382095815990..06aa7677c73b96bd51a0f7e5d5a770ccd6e690a2 100644
|
| --- a/sdk/lib/collection/collections.dart
|
| +++ b/sdk/lib/collection/collections.dart
|
| @@ -500,3 +500,17 @@ class Collections {
|
| static String collectionToString(Collection c)
|
| => ToString.collectionToString(c);
|
| }
|
| +
|
| +/**
|
| + * An unmodifiable [List] view of another List.
|
| + *
|
| + * The source of the elements may be a [List] or any [Iterable] with
|
| + * efficient [Iterable.length] and [Iterable.elementAt].
|
| + */
|
| +class UnmodifiableListView<E> extends UnmodifiableListBase<E> {
|
| + Iterable<E> _source;
|
| + /** Create an unmodifiable list backed by [source]. */
|
| + UnmodifiableListView(Iterable<E> source) : _source = source;
|
| + int get length => _source.length;
|
| + E operator[](int index) => _source.elementAt(index);
|
| +}
|
|
|