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

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

Issue 11299048: Revert "Add List.first." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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/byte_array.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 T removeLast() { 140 T removeLast() {
141 var len = length - 1; 141 var len = length - 1;
142 var elem = this[len]; 142 var elem = this[len];
143 this[len] = null; 143 this[len] = null;
144 _setLength(len); 144 _setLength(len);
145 return elem; 145 return elem;
146 } 146 }
147 147
148 T get first {
149 return this[0];
150 }
151
152 T get last { 148 T get last {
153 return this[length - 1]; 149 return this[length - 1];
154 } 150 }
155 151
156 int indexOf(T element, [int start = 0]) { 152 int indexOf(T element, [int start = 0]) {
157 return Arrays.indexOf(this, element, start, length); 153 return Arrays.indexOf(this, element, start, length);
158 } 154 }
159 155
160 int lastIndexOf(T element, [int start = null]) { 156 int lastIndexOf(T element, [int start = null]) {
161 if (start == null) start = length - 1; 157 if (start == null) start = length - 1;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 212 }
217 213
218 String toString() { 214 String toString() {
219 return Collections.collectionToString(this); 215 return Collections.collectionToString(this);
220 } 216 }
221 217
222 Iterator<T> iterator() { 218 Iterator<T> iterator() {
223 return new SequenceIterator<T>(this); 219 return new SequenceIterator<T>(this);
224 } 220 }
225 } 221 }
OLDNEW
« no previous file with comments | « runtime/lib/byte_array.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698