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

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

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 * Class implementing the read-operations on [List]. 8 * Class implementing the read-operations on [List].
9 * 9 *
10 * Implements all read-only operations, except [:operator[]:] and [:length:], 10 * Implements all read-only operations, except [:operator[]:] and [:length:],
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void add(E value) { 54 void add(E value) {
55 throw new UnsupportedError( 55 throw new UnsupportedError(
56 "Cannot add to a fixed-length list"); 56 "Cannot add to a fixed-length list");
57 } 57 }
58 58
59 void addLast(E value) { 59 void addLast(E value) {
60 throw new UnsupportedError( 60 throw new UnsupportedError(
61 "Cannot add to a fixed-length list"); 61 "Cannot add to a fixed-length list");
62 } 62 }
63 63
64 void insertAt(int index, E value) {
65 throw new UnsupportedError(
66 "Cannot add to a fixed-length list");
67 }
68
64 void addAll(Iterable<E> iterable) { 69 void addAll(Iterable<E> iterable) {
65 throw new UnsupportedError( 70 throw new UnsupportedError(
66 "Cannot add to a fixed-length list"); 71 "Cannot add to a fixed-length list");
67 } 72 }
68 73
69 void remove(E element) { 74 void remove(E element) {
70 throw new UnsupportedError( 75 throw new UnsupportedError(
71 "Cannot remove from a fixed-length list"); 76 "Cannot remove from a fixed-length list");
72 } 77 }
73 78
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 void add(E value) { 135 void add(E value) {
131 throw new UnsupportedError( 136 throw new UnsupportedError(
132 "Cannot add to an unmodifiable list"); 137 "Cannot add to an unmodifiable list");
133 } 138 }
134 139
135 void addLast(E value) { 140 void addLast(E value) {
136 throw new UnsupportedError( 141 throw new UnsupportedError(
137 "Cannot add to an unmodifiable list"); 142 "Cannot add to an unmodifiable list");
138 } 143 }
139 144
145 E insertAt(int index, E value) {
146 throw new UnsupportedError(
147 "Cannot add to an unmodifiable list");
148 }
149
140 void addAll(Iterable<E> iterable) { 150 void addAll(Iterable<E> iterable) {
141 throw new UnsupportedError( 151 throw new UnsupportedError(
142 "Cannot add to an unmodifiable list"); 152 "Cannot add to an unmodifiable list");
143 } 153 }
144 154
145 void remove(E element) { 155 void remove(E element) {
146 throw new UnsupportedError( 156 throw new UnsupportedError(
147 "Cannot remove from an unmodifiable list"); 157 "Cannot remove from an unmodifiable list");
148 } 158 }
149 159
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 */ 247 */
238 class CodeUnits extends UnmodifiableListBase<int> { 248 class CodeUnits extends UnmodifiableListBase<int> {
239 /** The string that this is the code units of. */ 249 /** The string that this is the code units of. */
240 String _string; 250 String _string;
241 251
242 CodeUnits(this._string); 252 CodeUnits(this._string);
243 253
244 int get length => _string.length; 254 int get length => _string.length;
245 int operator[](int i) => _string.codeUnitAt(i); 255 int operator[](int i) => _string.codeUnitAt(i);
246 } 256 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698