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 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 | 268 |
269 bool every(bool f(element)) { | 269 bool every(bool f(element)) { |
270 return IterableMixinWorkaround.every(this, f); | 270 return IterableMixinWorkaround.every(this, f); |
271 } | 271 } |
272 | 272 |
273 bool any(bool f(element)) { | 273 bool any(bool f(element)) { |
274 return IterableMixinWorkaround.any(this, f); | 274 return IterableMixinWorkaround.any(this, f); |
275 } | 275 } |
276 | 276 |
277 int firstMatching(bool test(int value), {int orElse()}) { | 277 int firstWhere(bool test(int value), {int orElse()}) { |
278 return IterableMixinWorkaround.firstMatching(this, test, orElse); | 278 return IterableMixinWorkaround.firstWhere(this, test, orElse); |
279 } | 279 } |
280 | 280 |
281 int lastMatching(bool test(int value), {int orElse()}) { | 281 int lastWhere(bool test(int value), {int orElse()}) { |
282 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); | 282 return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
283 } | 283 } |
284 | 284 |
285 int singleMatching(bool test(int value)) { | 285 int singleWhere(bool test(int value)) { |
286 return IterableMixinWorkaround.singleMatching(this, test); | 286 return IterableMixinWorkaround.singleWhere(this, test); |
287 } | 287 } |
288 | 288 |
289 int elementAt(int index) { | 289 int elementAt(int index) { |
290 return this[index]; | 290 return this[index]; |
291 } | 291 } |
292 | 292 |
293 bool get isEmpty { | 293 bool get isEmpty { |
294 return this.length == 0; | 294 return this.length == 0; |
295 } | 295 } |
296 | 296 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 void removeAll(Iterable elements) { | 350 void removeAll(Iterable elements) { |
351 throw new UnsupportedError( | 351 throw new UnsupportedError( |
352 "Cannot remove from a non-extendable array"); | 352 "Cannot remove from a non-extendable array"); |
353 } | 353 } |
354 | 354 |
355 void retainAll(Iterable elements) { | 355 void retainAll(Iterable elements) { |
356 throw new UnsupportedError( | 356 throw new UnsupportedError( |
357 "Cannot remove from a non-extendable array"); | 357 "Cannot remove from a non-extendable array"); |
358 } | 358 } |
359 | 359 |
360 void removeMatching(bool test(int element)) { | 360 void removeWhere(bool test(int element)) { |
361 throw new UnsupportedError( | 361 throw new UnsupportedError( |
362 "Cannot remove from a non-extendable array"); | 362 "Cannot remove from a non-extendable array"); |
363 } | 363 } |
364 | 364 |
365 void retainMatching(bool test(int element)) { | 365 void retainWhere(bool test(int element)) { |
366 throw new UnsupportedError( | 366 throw new UnsupportedError( |
367 "Cannot remove from a non-extendable array"); | 367 "Cannot remove from a non-extendable array"); |
368 } | 368 } |
369 | 369 |
370 int get first { | 370 int get first { |
371 if (length > 0) return this[0]; | 371 if (length > 0) return this[0]; |
372 throw new StateError("No elements"); | 372 throw new StateError("No elements"); |
373 } | 373 } |
374 | 374 |
375 int get last { | 375 int get last { |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 void removeAll(Iterable elements) { | 2023 void removeAll(Iterable elements) { |
2024 throw new UnsupportedError( | 2024 throw new UnsupportedError( |
2025 "Cannot remove from a non-extendable array"); | 2025 "Cannot remove from a non-extendable array"); |
2026 } | 2026 } |
2027 | 2027 |
2028 void retainAll(Iterable elements) { | 2028 void retainAll(Iterable elements) { |
2029 throw new UnsupportedError( | 2029 throw new UnsupportedError( |
2030 "Cannot remove from a non-extendable array"); | 2030 "Cannot remove from a non-extendable array"); |
2031 } | 2031 } |
2032 | 2032 |
2033 void removeMatching(bool test(int element)) { | 2033 void removeWhere(bool test(int element)) { |
2034 throw new UnsupportedError( | 2034 throw new UnsupportedError( |
2035 "Cannot remove from a non-extendable array"); | 2035 "Cannot remove from a non-extendable array"); |
2036 } | 2036 } |
2037 | 2037 |
2038 void retainMatching(bool test(int element)) { | 2038 void retainWhere(bool test(int element)) { |
2039 throw new UnsupportedError( | 2039 throw new UnsupportedError( |
2040 "Cannot remove from a non-extendable array"); | 2040 "Cannot remove from a non-extendable array"); |
2041 } | 2041 } |
2042 | 2042 |
2043 int get first { | 2043 int get first { |
2044 if (length > 0) return this[0]; | 2044 if (length > 0) return this[0]; |
2045 throw new StateError("No elements"); | 2045 throw new StateError("No elements"); |
2046 } | 2046 } |
2047 | 2047 |
2048 int get last { | 2048 int get last { |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 ByteArray asByteArray([int start = 0, int length]) { | 2707 ByteArray asByteArray([int start = 0, int length]) { |
2708 if (length == null) { | 2708 if (length == null) { |
2709 length = this.lengthInBytes(); | 2709 length = this.lengthInBytes(); |
2710 } | 2710 } |
2711 _rangeCheck(this.length, start, length); | 2711 _rangeCheck(this.length, start, length); |
2712 return _array.subByteArray(_offset + start, length); | 2712 return _array.subByteArray(_offset + start, length); |
2713 } | 2713 } |
2714 | 2714 |
2715 static const int _BYTES_PER_ELEMENT = 8; | 2715 static const int _BYTES_PER_ELEMENT = 8; |
2716 } | 2716 } |
OLD | NEW |