OLD | NEW |
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 284 } |
285 | 285 |
286 bool get isEmpty { | 286 bool get isEmpty { |
287 return this.length == 0; | 287 return this.length == 0; |
288 } | 288 } |
289 | 289 |
290 void clear() { | 290 void clear() { |
291 this.length = 0; | 291 this.length = 0; |
292 } | 292 } |
293 | 293 |
| 294 List<T> get reversed => new ReversedListView<T>(this, 0, null); |
| 295 |
294 void sort([int compare(T a, T b)]) { | 296 void sort([int compare(T a, T b)]) { |
295 IterableMixinWorkaround.sortList(this, compare); | 297 IterableMixinWorkaround.sortList(this, compare); |
296 } | 298 } |
297 | 299 |
298 String toString() { | 300 String toString() { |
299 return Collections.collectionToString(this); | 301 return Collections.collectionToString(this); |
300 } | 302 } |
301 | 303 |
302 Iterator<T> get iterator { | 304 Iterator<T> get iterator { |
303 return new ListIterator<T>(this); | 305 return new ListIterator<T>(this); |
304 } | 306 } |
305 | 307 |
306 List<T> toList() { | 308 List<T> toList() { |
307 return new List<T>.from(this); | 309 return new List<T>.from(this); |
308 } | 310 } |
309 | 311 |
310 Set<T> toSet() { | 312 Set<T> toSet() { |
311 return new Set<T>.from(this); | 313 return new Set<T>.from(this); |
312 } | 314 } |
313 } | 315 } |
OLD | NEW |