| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void addAll(Iterable<E> iterable) { | 118 void addAll(Iterable<E> iterable) { |
| 119 throw new UnsupportedError( | 119 throw new UnsupportedError( |
| 120 "Cannot add to an unmodifiable list"); | 120 "Cannot add to an unmodifiable list"); |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool remove(Object element) { | 123 bool remove(Object element) { |
| 124 throw new UnsupportedError( | 124 throw new UnsupportedError( |
| 125 "Cannot remove from an unmodifiable list"); | 125 "Cannot remove from an unmodifiable list"); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void removeAll(Iterable elements) { | |
| 129 throw new UnsupportedError( | |
| 130 "Cannot remove from an unmodifiable list"); | |
| 131 } | |
| 132 | |
| 133 void retainAll(Iterable elements) { | |
| 134 throw new UnsupportedError( | |
| 135 "Cannot remove from an unmodifiable list"); | |
| 136 } | |
| 137 | |
| 138 void removeWhere(bool test(E element)) { | 128 void removeWhere(bool test(E element)) { |
| 139 throw new UnsupportedError( | 129 throw new UnsupportedError( |
| 140 "Cannot remove from an unmodifiable list"); | 130 "Cannot remove from an unmodifiable list"); |
| 141 } | 131 } |
| 142 | 132 |
| 143 void retainWhere(bool test(E element)) { | 133 void retainWhere(bool test(E element)) { |
| 144 throw new UnsupportedError( | 134 throw new UnsupportedError( |
| 145 "Cannot remove from an unmodifiable list"); | 135 "Cannot remove from an unmodifiable list"); |
| 146 } | 136 } |
| 147 | 137 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } | 254 } |
| 265 | 255 |
| 266 class ReversedListIterable<E> extends ListIterable<E> { | 256 class ReversedListIterable<E> extends ListIterable<E> { |
| 267 Iterable<E> _source; | 257 Iterable<E> _source; |
| 268 ReversedListIterable(this._source); | 258 ReversedListIterable(this._source); |
| 269 | 259 |
| 270 int get length => _source.length; | 260 int get length => _source.length; |
| 271 | 261 |
| 272 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); | 262 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); |
| 273 } | 263 } |
| OLD | NEW |