OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 * Mixin that throws on the length changing operations of [List]. | 8 * Mixin that throws on the length changing operations of [List]. |
9 * | 9 * |
10 * Intended to mix-in on top of [ListMixin] for fixed-length lists. | 10 * Intended to mix-in on top of [ListMixin] for fixed-length lists. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 E removeAt(int index) { | 153 E removeAt(int index) { |
154 throw new UnsupportedError( | 154 throw new UnsupportedError( |
155 "Cannot remove from an unmodifiable list"); | 155 "Cannot remove from an unmodifiable list"); |
156 } | 156 } |
157 | 157 |
158 E removeLast() { | 158 E removeLast() { |
159 throw new UnsupportedError( | 159 throw new UnsupportedError( |
160 "Cannot remove from an unmodifiable list"); | 160 "Cannot remove from an unmodifiable list"); |
161 } | 161 } |
162 | 162 |
163 void setRange(int start, int length, List<E> from, [int startFrom]) { | 163 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { |
164 throw new UnsupportedError( | 164 throw new UnsupportedError( |
165 "Cannot modify an unmodifiable list"); | 165 "Cannot modify an unmodifiable list"); |
166 } | 166 } |
167 | 167 |
168 void removeRange(int start, int length) { | 168 void removeRange(int start, int length) { |
169 throw new UnsupportedError( | 169 throw new UnsupportedError( |
170 "Cannot remove from an unmodifiable list"); | 170 "Cannot remove from an unmodifiable list"); |
171 } | 171 } |
172 | 172 |
173 void insertRange(int start, int length, [E initialValue]) { | 173 void insertRange(int start, int length, [E initialValue]) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 249 } |
250 | 250 |
251 class ReversedListIterable<E> extends ListIterable<E> { | 251 class ReversedListIterable<E> extends ListIterable<E> { |
252 Iterable<E> _source; | 252 Iterable<E> _source; |
253 ReversedListIterable(this._source); | 253 ReversedListIterable(this._source); |
254 | 254 |
255 int get length => _source.length; | 255 int get length => _source.length; |
256 | 256 |
257 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); | 257 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); |
258 } | 258 } |
OLD | NEW |