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

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

Issue 13956006: Remove insertRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild DOM (unrelated CL) and update status files. Created 7 years, 8 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
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 E removeAt(int index) { 63 E removeAt(int index) {
64 throw new UnsupportedError( 64 throw new UnsupportedError(
65 "Cannot remove from a fixed-length list"); 65 "Cannot remove from a fixed-length list");
66 } 66 }
67 67
68 E removeLast() { 68 E removeLast() {
69 throw new UnsupportedError( 69 throw new UnsupportedError(
70 "Cannot remove from a fixed-length list"); 70 "Cannot remove from a fixed-length list");
71 } 71 }
72 72
73 void removeRange(int start, int length) { 73 void removeRange(int start, int end) {
74 throw new UnsupportedError( 74 throw new UnsupportedError(
75 "Cannot remove from a fixed-length list"); 75 "Cannot remove from a fixed-length list");
76 } 76 }
77
78 void insertRange(int start, int length, [E initialValue]) {
79 throw new UnsupportedError(
80 "Cannot insert range in a fixed-length list");
81 }
82 } 77 }
83 78
84 /** 79 /**
85 * Mixin for an unmodifiable [List] class. 80 * Mixin for an unmodifiable [List] class.
86 * 81 *
87 * This overrides all mutating methods with methods that throw. 82 * This overrides all mutating methods with methods that throw.
88 * This mixin is intended to be mixed in on top of [ListMixin] on 83 * This mixin is intended to be mixed in on top of [ListMixin] on
89 * unmodifiable lists. 84 * unmodifiable lists.
90 */ 85 */
91 abstract class UnmodifiableListMixin<E> { 86 abstract class UnmodifiableListMixin<E> {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 E removeLast() { 153 E removeLast() {
159 throw new UnsupportedError( 154 throw new UnsupportedError(
160 "Cannot remove from an unmodifiable list"); 155 "Cannot remove from an unmodifiable list");
161 } 156 }
162 157
163 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { 158 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
164 throw new UnsupportedError( 159 throw new UnsupportedError(
165 "Cannot modify an unmodifiable list"); 160 "Cannot modify an unmodifiable list");
166 } 161 }
167 162
168 void removeRange(int start, int length) { 163 void removeRange(int start, int end) {
169 throw new UnsupportedError( 164 throw new UnsupportedError(
170 "Cannot remove from an unmodifiable list"); 165 "Cannot remove from an unmodifiable list");
171 } 166 }
172
173 void insertRange(int start, int length, [E initialValue]) {
174 throw new UnsupportedError(
175 "Cannot insert range in an unmodifiable list");
176 }
177 } 167 }
178 168
179 /** 169 /**
180 * Abstract implementation of a fixed-length list. 170 * Abstract implementation of a fixed-length list.
181 * 171 *
182 * All operations are defined in terms of `length`, `operator[]` and 172 * All operations are defined in terms of `length`, `operator[]` and
183 * `operator[]=`, which need to be implemented. 173 * `operator[]=`, which need to be implemented.
184 */ 174 */
185 typedef FixedLengthListBase<E> = ListBase<E> with FixedLengthListMixin<E>; 175 typedef FixedLengthListBase<E> = ListBase<E> with FixedLengthListMixin<E>;
186 176
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 239 }
250 240
251 class ReversedListIterable<E> extends ListIterable<E> { 241 class ReversedListIterable<E> extends ListIterable<E> {
252 Iterable<E> _source; 242 Iterable<E> _source;
253 ReversedListIterable(this._source); 243 ReversedListIterable(this._source);
254 244
255 int get length => _source.length; 245 int get length => _source.length;
256 246
257 E elementAt(int index) => _source.elementAt(_source.length - 1 - index); 247 E elementAt(int index) => _source.elementAt(_source.length - 1 - index);
258 } 248 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/observable/observable.dart ('k') | sdk/lib/_internal/compiler/implementation/lib/js_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698