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

Side by Side Diff: runtime/lib/growable_array.dart

Issue 13774006: Moving ListBase, FixedLengthListMixin and UmodifiableListMixin to collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moved ReversedListIterable back to collection-dev 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
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/string_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class _GrowableObjectArray<T> implements List<T> { 5 class _GrowableObjectArray<T> implements List<T> {
6 factory _GrowableObjectArray._uninstantiable() { 6 factory _GrowableObjectArray._uninstantiable() {
7 throw new UnsupportedError( 7 throw new UnsupportedError(
8 "GrowableObjectArray can only be allocated by the VM"); 8 "GrowableObjectArray can only be allocated by the VM");
9 } 9 }
10 10
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 321 }
322 322
323 bool get isEmpty { 323 bool get isEmpty {
324 return this.length == 0; 324 return this.length == 0;
325 } 325 }
326 326
327 void clear() { 327 void clear() {
328 this.length = 0; 328 this.length = 0;
329 } 329 }
330 330
331 Iterable<T> get reversed => new ReversedListIterable<T>(this); 331 Iterable<T> get reversed => IterableMixinWorkaround.reversedList(this);
332 332
333 void sort([int compare(T a, T b)]) { 333 void sort([int compare(T a, T b)]) {
334 IterableMixinWorkaround.sortList(this, compare); 334 IterableMixinWorkaround.sortList(this, compare);
335 } 335 }
336 336
337 String toString() { 337 String toString() {
338 return Collections.collectionToString(this); 338 return Collections.collectionToString(this);
339 } 339 }
340 340
341 Iterator<T> get iterator { 341 Iterator<T> get iterator {
342 return new ListIterator<T>(this); 342 return new ListIterator<T>(this);
343 } 343 }
344 344
345 List<T> toList({ bool growable: true }) { 345 List<T> toList({ bool growable: true }) {
346 return new List<T>.from(this, growable: growable); 346 return new List<T>.from(this, growable: growable);
347 } 347 }
348 348
349 Set<T> toSet() { 349 Set<T> toSet() {
350 return new Set<T>.from(this); 350 return new Set<T>.from(this);
351 } 351 }
352 352
353 Map<int, T> asMap() { 353 Map<int, T> asMap() {
354 return IterableMixinWorkaround.asMapList(this); 354 return IterableMixinWorkaround.asMapList(this);
355 } 355 }
356 } 356 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/string_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698