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

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

Issue 11931034: Add methods to Collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.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 patch class Int8List { 5 patch class Int8List {
6 /* patch */ factory Int8List(int length) { 6 /* patch */ factory Int8List(int length) {
7 return new _Int8Array(length); 7 return new _Int8Array(length);
8 } 8 }
9 9
10 /* patch */ factory Int8List.transferable(int length) { 10 /* patch */ factory Int8List.transferable(int length) {
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 void clear() { 300 void clear() {
301 throw new UnsupportedError( 301 throw new UnsupportedError(
302 "Cannot remove from a non-extendable array"); 302 "Cannot remove from a non-extendable array");
303 } 303 }
304 304
305 int removeLast() { 305 int removeLast() {
306 throw new UnsupportedError( 306 throw new UnsupportedError(
307 "Cannot remove from a non-extendable array"); 307 "Cannot remove from a non-extendable array");
308 } 308 }
309 309
310 void remove(Object element) {
311 throw new UnsupportedError(
312 "Cannot remove from a non-extendable array");
313 }
314
315 void removeAll(Iterable elements) {
316 throw new UnsupportedError(
317 "Cannot remove from a non-extendable array");
318 }
319
320 void retainAll(Iterable elements) {
321 throw new UnsupportedError(
322 "Cannot remove from a non-extendable array");
323 }
324
325 void removeMatching(bool test(int element)) {
326 throw new UnsupportedError(
327 "Cannot remove from a non-extendable array");
328 }
329
330 void retainMatching(bool test(int element)) {
331 throw new UnsupportedError(
332 "Cannot remove from a non-extendable array");
333 }
334
310 int get first { 335 int get first {
311 if (length > 0) return this[0]; 336 if (length > 0) return this[0];
312 throw new StateError("No elements"); 337 throw new StateError("No elements");
313 } 338 }
314 339
315 int get last { 340 int get last {
316 if (length > 0) return this[length - 1]; 341 if (length > 0) return this[length - 1];
317 throw new StateError("No elements"); 342 throw new StateError("No elements");
318 } 343 }
319 344
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 void clear() { 2004 void clear() {
1980 throw new UnsupportedError( 2005 throw new UnsupportedError(
1981 "Cannot remove from a non-extendable array"); 2006 "Cannot remove from a non-extendable array");
1982 } 2007 }
1983 2008
1984 int removeLast() { 2009 int removeLast() {
1985 throw new UnsupportedError( 2010 throw new UnsupportedError(
1986 "Cannot remove from a non-extendable array"); 2011 "Cannot remove from a non-extendable array");
1987 } 2012 }
1988 2013
2014 int removeAt(int index) {
2015 throw new UnsupportedError(
2016 "Cannot remove from a non-extendable array");
2017 }
2018
2019 void remove(Object element) {
2020 throw new UnsupportedError(
2021 "Cannot remove from a non-extendable array");
2022 }
2023
2024 void removeAll(Iterable elements) {
2025 throw new UnsupportedError(
2026 "Cannot remove from a non-extendable array");
2027 }
2028
2029 void retainAll(Iterable elements) {
2030 throw new UnsupportedError(
2031 "Cannot remove from a non-extendable array");
2032 }
2033
2034 void removeMatching(bool test(int element)) {
2035 throw new UnsupportedError(
2036 "Cannot remove from a non-extendable array");
2037 }
2038
2039 void retainMatching(bool test(int element)) {
2040 throw new UnsupportedError(
2041 "Cannot remove from a non-extendable array");
2042 }
2043
1989 int get first { 2044 int get first {
1990 if (length > 0) return this[0]; 2045 if (length > 0) return this[0];
1991 throw new StateError("No elements"); 2046 throw new StateError("No elements");
1992 } 2047 }
1993 2048
1994 int get last { 2049 int get last {
1995 if (length > 0) return this[length - 1]; 2050 if (length > 0) return this[length - 1];
1996 throw new StateError("No elements"); 2051 throw new StateError("No elements");
1997 } 2052 }
1998 2053
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
2649 ByteArray asByteArray([int start = 0, int length]) { 2704 ByteArray asByteArray([int start = 0, int length]) {
2650 if (length == null) { 2705 if (length == null) {
2651 length = this.lengthInBytes(); 2706 length = this.lengthInBytes();
2652 } 2707 }
2653 _rangeCheck(this.length, start, length); 2708 _rangeCheck(this.length, start, length);
2654 return _array.subByteArray(_offset + start, length); 2709 return _array.subByteArray(_offset + start, length);
2655 } 2710 }
2656 2711
2657 static const int _BYTES_PER_ELEMENT = 8; 2712 static const int _BYTES_PER_ELEMENT = 8;
2658 } 2713 }
OLDNEW
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698