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

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

Issue 11931034: Add methods to Collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also on DoubleLinkedQueue. Created 7 years, 11 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * A [List] is an indexable collection with a length. It can be of 8 * A [List] is an indexable collection with a length. It can be of
9 * fixed size or extendable. 9 * fixed size or extendable.
10 */ 10 */
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 void addLast(E value) { 297 void addLast(E value) {
298 throw new UnsupportedError( 298 throw new UnsupportedError(
299 "Cannot add to an unmodifiable list"); 299 "Cannot add to an unmodifiable list");
300 } 300 }
301 301
302 void addAll(Iterable<E> iterable) { 302 void addAll(Iterable<E> iterable) {
303 throw new UnsupportedError( 303 throw new UnsupportedError(
304 "Cannot add to an unmodifiable list"); 304 "Cannot add to an unmodifiable list");
305 } 305 }
306 306
307 void remove(E element) {
308 throw new UnsupportedError(
309 "Cannot remove in an unmodifiable list");
floitsch 2013/01/17 13:36:58 remove from ...
Lasse Reichstein Nielsen 2013/01/18 11:41:48 Done.
310 }
311
312 void removeAll(Iterable elements) {
313 throw new UnsupportedError(
314 "Cannot remove in an unmodifiable list");
315 }
316
317 void retainAll(Iterable elements) {
318 throw new UnsupportedError(
319 "Cannot remove in an unmodifiable list");
320 }
321
322 void removeMatching(bool test(E element)) {
323 throw new UnsupportedError(
324 "Cannot remove in an unmodifiable list");
325 }
326
307 void sort([Comparator<E> compare]) { 327 void sort([Comparator<E> compare]) {
308 throw new UnsupportedError( 328 throw new UnsupportedError(
309 "Cannot modify an unmodifiable list"); 329 "Cannot modify an unmodifiable list");
310 } 330 }
311 331
312 void clear() { 332 void clear() {
313 throw new UnsupportedError( 333 throw new UnsupportedError(
314 "Cannot clear an unmodifiable list"); 334 "Cannot clear an unmodifiable list");
315 } 335 }
316 336
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 446
427 ListView<E> take(int takeCount) { 447 ListView<E> take(int takeCount) {
428 if (takeCount is! int || takeCount < 0) { 448 if (takeCount is! int || takeCount < 0) {
429 throw new ArgumentError(takeCount); 449 throw new ArgumentError(takeCount);
430 } 450 }
431 int newLength = takeCount; 451 int newLength = takeCount;
432 if (_length != null && takeCount > _length) newLength = _length; 452 if (_length != null && takeCount > _length) newLength = _length;
433 return new ListView(_list, _offset, newLength); 453 return new ListView(_list, _offset, newLength);
434 } 454 }
435 } 455 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698