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

Side by Side Diff: lib/growable_array.dart

Issue 9999009: Fix build break. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « no previous file | no next file » | 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 const UnsupportedOperationException( 7 throw const UnsupportedOperationException(
8 "GrowableObjectArray can only be allocated by the VM"); 8 "GrowableObjectArray can only be allocated by the VM");
9 } 9 }
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 Arrays.copy(this, start, list, 0, length); 72 Arrays.copy(this, start, list, 0, length);
73 return list; 73 return list;
74 } 74 }
75 75
76 factory GrowableObjectArray() { 76 factory GrowableObjectArray() {
77 var data = new ObjectArray<T>(4); 77 var data = new ObjectArray<T>(4);
78 return new GrowableObjectArray<T>.fromObjectArray(data); 78 return new GrowableObjectArray<T>.fromObjectArray(data);
79 } 79 }
80 80
81 factory GrowableObjectArray.withCapacity(int capacity) { 81 factory GrowableObjectArray.withCapacity(int capacity) {
82 var data = new ObjectArray<T>(capacity); 82 var data = new ObjectArray<T>((capacity == 0)? 4 : capacity);
83 return new GrowableObjectArray<T>.fromObjectArray(data); 83 return new GrowableObjectArray<T>.fromObjectArray(data);
84 } 84 }
85 85
86 factory GrowableObjectArray.from(Collection<T> other) { 86 factory GrowableObjectArray.from(Collection<T> other) {
87 List<T> result = new GrowableObjectArray<T>(); 87 List<T> result = new GrowableObjectArray<T>();
88 result.addAll(other); 88 result.addAll(other);
89 return result; 89 return result;
90 } 90 }
91 91
92 factory GrowableObjectArray.fromObjectArray(ObjectArray<T> data) 92 factory GrowableObjectArray.fromObjectArray(ObjectArray<T> data)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 T next() { 237 T next() {
238 if (!hasNext()) { 238 if (!hasNext()) {
239 throw const NoMoreElementsException(); 239 throw const NoMoreElementsException();
240 } 240 }
241 return _array[_pos++]; 241 return _array[_pos++];
242 } 242 }
243 243
244 final GrowableObjectArray<T> _array; 244 final GrowableObjectArray<T> _array;
245 int _pos; 245 int _pos;
246 } 246 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698