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

Unified Diff: runtime/lib/typed_data.dart

Issue 763443005: Fix implementation of the Iterable interface for typed data lists. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typed_data.dart
===================================================================
--- runtime/lib/typed_data.dart (revision 42039)
+++ runtime/lib/typed_data.dart (working copy)
@@ -275,40 +275,6 @@
return IterableMixinWorkaround.expand(this, f);
}
- // The following methods need to know the element type (int or double).
- Iterable where(bool f(element)) {
- return new IterableMixinWorkaround().where(this, f);
- }
-
- Iterable take(int n) {
- return new IterableMixinWorkaround().takeList(this, n);
- }
-
- Iterable takeWhile(bool test(element)) {
- return new IterableMixinWorkaround().takeWhile(this, test);
- }
-
- Iterable skip(int n) {
- return new IterableMixinWorkaround().skipList(this, n);
- }
-
- Iterable skipWhile(bool test(element)) {
- return new IterableMixinWorkaround().skipWhile(this, test);
- }
-
- Iterable<dynamic> get reversed {
- return new IterableMixinWorkaround().reversedList(this);
- }
-
- Map<int, dynamic> asMap() {
- return new IterableMixinWorkaround().asMapList(this);
- }
-
- Iterable getRange(int start, [int end]) {
- return new IterableMixinWorkaround().getRangeList(this, start, end);
- }
- // End of methods returning incorrectly parameterized types.
-
bool every(bool f(element)) {
return IterableMixinWorkaround.every(this, f);
}
@@ -535,6 +501,136 @@
}
+class _IntListMixin {
+ Iterable<int> where(bool f(int element)) => new WhereIterable<int>(this, f);
+
+ Iterable<int> take(int n) => new SubListIterable<int>(this, 0, n);
+
+ Iterable<int> takeWhile(bool test(int element)) =>
+ new TakeWhileIterable<int>(this, test);
+
+ Iterable<int> skip(int n) => new SubListIterable<int>(this, n, null);
+
+ Iterable<int> skipWhile(bool test(element)) =>
+ new SkipWhileIterable<int>(this, test);
+
+ Iterable<int> get reversed => new ReversedListIterable<int>(this);
+
+ Map<int, int> asMap() => new ListMapView<int>(this);
+
+ Iterable<int> getRange(int start, [int end]) {
+ RangeError.checkValidRange(start, end, this.length);
+ return new SubListIterable<int>(this, start, end);
+ }
+
+ Iterator<int> get iterator => new _TypedListIterator<int>(this);
+}
+
+
+class _DoubleListMixin {
+ Iterable<double> where(bool f(int element)) => new WhereIterable<double>(this, f);
Lasse Reichstein Nielsen 2014/12/02 12:02:54 Long line (repeated below).
Florian Schneider 2014/12/02 12:17:26 Done.
+
+ Iterable<double> take(int n) => new SubListIterable<double>(this, 0, n);
+
+ Iterable<double> takeWhile(bool test(int element)) =>
+ new TakeWhileIterable<double>(this, test);
+
+ Iterable<double> skip(int n) => new SubListIterable<double>(this, n, null);
+
+ Iterable<double> skipWhile(bool test(element)) =>
+ new SkipWhileIterable<double>(this, test);
+
+ Iterable<double> get reversed => new ReversedListIterable<double>(this);
+
+ Map<int, double> asMap() => new ListMapView<double>(this);
+
+ Iterable<double> getRange(int start, [int end]) {
+ RangeError.checkValidRange(start, end, this.length);
+ return new SubListIterable<double>(this, start, end);
+ }
+
+ Iterator<double> get iterator => new _TypedListIterator<double>(this);
+}
+
+
+class _Float32x4ListMixin {
+ Iterable<Float32x4> where(bool f(int element)) => new WhereIterable<Float32x4>(this, f);
+
+ Iterable<Float32x4> take(int n) => new SubListIterable<Float32x4>(this, 0, n);
+
+ Iterable<Float32x4> takeWhile(bool test(int element)) =>
+ new TakeWhileIterable<Float32x4>(this, test);
+
+ Iterable<Float32x4> skip(int n) => new SubListIterable<Float32x4>(this, n, null);
Lasse Reichstein Nielsen 2014/12/02 12:02:54 Long line.
Florian Schneider 2014/12/02 12:17:26 Done.
+
+ Iterable<Float32x4> skipWhile(bool test(element)) =>
+ new SkipWhileIterable<Float32x4>(this, test);
+
+ Iterable<Float32x4> get reversed => new ReversedListIterable<Float32x4>(this);
+
+ Map<int, Float32x4> asMap() => new ListMapView<Float32x4>(this);
+
+ Iterable<Float32x4> getRange(int start, [int end]) {
+ RangeError.checkValidRange(start, end, this.length);
+ return new SubListIterable<Float32x4>(this, start, end);
+ }
+
+ Iterator<Float32x4> get iterator => new _TypedListIterator<Float32x4>(this);
+}
+
+
+class _Int32x4ListMixin {
+ Iterable<Int32x4> where(bool f(int element)) => new WhereIterable<Int32x4>(this, f);
+
+ Iterable<Int32x4> take(int n) => new SubListIterable<Int32x4>(this, 0, n);
+
+ Iterable<Int32x4> takeWhile(bool test(int element)) =>
+ new TakeWhileIterable<Int32x4>(this, test);
+
+ Iterable<Int32x4> skip(int n) => new SubListIterable<Int32x4>(this, n, null);
+
+ Iterable<Int32x4> skipWhile(bool test(element)) =>
+ new SkipWhileIterable<Int32x4>(this, test);
+
+ Iterable<Int32x4> get reversed => new ReversedListIterable<Int32x4>(this);
+
+ Map<int, Int32x4> asMap() => new ListMapView<Int32x4>(this);
+
+ Iterable<Int32x4> getRange(int start, [int end]) {
+ RangeError.checkValidRange(start, end, this.length);
+ return new SubListIterable<Int32x4>(this, start, end);
+ }
+
+ Iterator<Int32x4> get iterator => new _TypedListIterator<Int32x4>(this);
+}
+
+
+class _Float64x2ListMixin {
+ Iterable<Float64x2> where(bool f(int element)) => new WhereIterable<Float64x2>(this, f);
+
+ Iterable<Float64x2> take(int n) => new SubListIterable<Float64x2>(this, 0, n);
+
+ Iterable<Float64x2> takeWhile(bool test(int element)) =>
+ new TakeWhileIterable<Float64x2>(this, test);
+
+ Iterable<Float64x2> skip(int n) => new SubListIterable<Float64x2>(this, n, null);
+
+ Iterable<Float64x2> skipWhile(bool test(element)) =>
+ new SkipWhileIterable<Float64x2>(this, test);
+
+ Iterable<Float64x2> get reversed => new ReversedListIterable<Float64x2>(this);
+
+ Map<int, Float64x2> asMap() => new ListMapView<Float64x2>(this);
+
+ Iterable<Float64x2> getRange(int start, [int end]) {
+ RangeError.checkValidRange(start, end, this.length);
+ return new SubListIterable<Float64x2>(this, start, end);
+ }
+
+ Iterator<Float64x2> get iterator => new _TypedListIterator<Float64x2>(this);
+}
+
+
class _ByteBuffer implements ByteBuffer {
final _TypedList _data;
@@ -730,7 +826,7 @@
}
-class _Int8Array extends _TypedList implements Int8List {
+class _Int8Array extends _TypedList with _IntListMixin implements Int8List {
Lasse Reichstein Nielsen 2014/12/02 12:02:54 Would it work to do: extends _TypedList with Lis
Florian Schneider 2014/12/02 12:17:26 In principle it would work. The down-side would be
// Factory constructors.
factory _Int8Array(int length) {
@@ -754,11 +850,7 @@
_setInt8(index, _toInt8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -776,7 +868,7 @@
}
-class _Uint8Array extends _TypedList implements Uint8List {
+class _Uint8Array extends _TypedList with _IntListMixin implements Uint8List {
// Factory constructors.
factory _Uint8Array(int length) {
@@ -799,11 +891,7 @@
_setUint8(index, _toUint8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Methods implementing TypedData interface.
int get elementSizeInBytes {
return Uint8List.BYTES_PER_ELEMENT;
@@ -820,7 +908,7 @@
}
-class _Uint8ClampedArray extends _TypedList implements Uint8ClampedList {
+class _Uint8ClampedArray extends _TypedList with _IntListMixin implements Uint8ClampedList {
// Factory constructors.
factory _Uint8ClampedArray(int length) {
@@ -843,11 +931,7 @@
_setUint8(index, _toClampedUint8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Methods implementing TypedData interface.
int get elementSizeInBytes {
return Uint8List.BYTES_PER_ELEMENT;
@@ -865,7 +949,7 @@
}
-class _Int16Array extends _TypedList implements Int16List {
+class _Int16Array extends _TypedList with _IntListMixin implements Int16List {
// Factory constructors.
factory _Int16Array(int length) {
@@ -889,11 +973,7 @@
_setIndexedInt16(index, _toInt16(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -919,7 +999,7 @@
}
-class _Uint16Array extends _TypedList implements Uint16List {
+class _Uint16Array extends _TypedList with _IntListMixin implements Uint16List {
// Factory constructors.
factory _Uint16Array(int length) {
@@ -943,11 +1023,7 @@
_setIndexedUint16(index, _toUint16(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -973,7 +1049,7 @@
}
-class _Int32Array extends _TypedList implements Int32List {
+class _Int32Array extends _TypedList with _IntListMixin implements Int32List {
// Factory constructors.
factory _Int32Array(int length) {
@@ -997,11 +1073,7 @@
_setIndexedInt32(index, _toInt32(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -1027,7 +1099,7 @@
}
-class _Uint32Array extends _TypedList implements Uint32List {
+class _Uint32Array extends _TypedList with _IntListMixin implements Uint32List {
// Factory constructors.
factory _Uint32Array(int length) {
@@ -1051,11 +1123,7 @@
_setIndexedUint32(index, _toUint32(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1081,7 +1149,7 @@
}
-class _Int64Array extends _TypedList implements Int64List {
+class _Int64Array extends _TypedList with _IntListMixin implements Int64List {
// Factory constructors.
factory _Int64Array(int length) {
@@ -1105,11 +1173,7 @@
_setIndexedInt64(index, _toInt64(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1135,7 +1199,7 @@
}
-class _Uint64Array extends _TypedList implements Uint64List {
+class _Uint64Array extends _TypedList with _IntListMixin implements Uint64List {
// Factory constructors.
factory _Uint64Array(int length) {
@@ -1159,11 +1223,7 @@
_setIndexedUint64(index, _toUint64(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1189,7 +1249,7 @@
}
-class _Float32Array extends _TypedList implements Float32List {
+class _Float32Array extends _TypedList with _DoubleListMixin implements Float32List {
// Factory constructors.
factory _Float32Array(int length) {
@@ -1213,11 +1273,7 @@
_setIndexedFloat32(index, value);
}
- Iterator<double> get iterator {
- return new _TypedListIterator<double>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1243,7 +1299,7 @@
}
-class _Float64Array extends _TypedList implements Float64List {
+class _Float64Array extends _TypedList with _DoubleListMixin implements Float64List {
// Factory constructors.
factory _Float64Array(int length) {
@@ -1267,11 +1323,7 @@
_setIndexedFloat64(index, value);
}
- Iterator<double> get iterator {
- return new _TypedListIterator<double>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1297,7 +1349,7 @@
}
-class _Float32x4Array extends _TypedList implements Float32x4List {
+class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Float32x4List {
// Factory constructors.
factory _Float32x4Array(int length) {
@@ -1319,11 +1371,7 @@
_setIndexedFloat32x4(index, value);
}
- Iterator<Float32x4> get iterator {
- return new _TypedListIterator<Float32x4>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1349,7 +1397,7 @@
}
-class _Int32x4Array extends _TypedList implements Int32x4List {
+class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4List {
// Factory constructors.
factory _Int32x4Array(int length) {
@@ -1371,11 +1419,7 @@
_setIndexedInt32x4(index, value);
}
- Iterator<Int32x4> get iterator {
- return new _TypedListIterator<Int32x4>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1401,7 +1445,7 @@
}
-class _Float64x2Array extends _TypedList implements Float64x2List {
+class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Float64x2List {
// Factory constructors.
factory _Float64x2Array(int length) {
@@ -1423,11 +1467,7 @@
_setIndexedFloat64x2(index, value);
}
- Iterator<Float64x2> get iterator {
- return new _TypedListIterator<Float64x2>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1453,7 +1493,7 @@
}
-class _ExternalInt8Array extends _TypedList implements Int8List {
+class _ExternalInt8Array extends _TypedList with _IntListMixin implements Int8List {
// Factory constructors.
factory _ExternalInt8Array(int length) {
@@ -1476,11 +1516,7 @@
_setInt8(index, value);
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1499,7 +1535,7 @@
}
-class _ExternalUint8Array extends _TypedList implements Uint8List {
+class _ExternalUint8Array extends _TypedList with _IntListMixin implements Uint8List {
// Factory constructors.
factory _ExternalUint8Array(int length) {
@@ -1523,11 +1559,7 @@
_setUint8(index, _toUint8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1546,7 +1578,7 @@
}
-class _ExternalUint8ClampedArray extends _TypedList implements Uint8ClampedList {
+class _ExternalUint8ClampedArray extends _TypedList with _IntListMixin implements Uint8ClampedList {
// Factory constructors.
factory _ExternalUint8ClampedArray(int length) {
@@ -1569,11 +1601,7 @@
_setUint8(index, _toClampedUint8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1592,7 +1620,7 @@
}
-class _ExternalInt16Array extends _TypedList implements Int16List {
+class _ExternalInt16Array extends _TypedList with _IntListMixin implements Int16List {
// Factory constructors.
factory _ExternalInt16Array(int length) {
@@ -1616,11 +1644,7 @@
_setIndexedInt16(index, _toInt16(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1647,7 +1671,7 @@
}
-class _ExternalUint16Array extends _TypedList implements Uint16List {
+class _ExternalUint16Array extends _TypedList with _IntListMixin implements Uint16List {
// Factory constructors.
factory _ExternalUint16Array(int length) {
@@ -1671,11 +1695,7 @@
_setIndexedUint16(index, _toUint16(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1702,7 +1722,7 @@
}
-class _ExternalInt32Array extends _TypedList implements Int32List {
+class _ExternalInt32Array extends _TypedList with _IntListMixin implements Int32List {
// Factory constructors.
factory _ExternalInt32Array(int length) {
@@ -1726,11 +1746,7 @@
_setIndexedInt32(index, _toInt32(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1757,7 +1773,7 @@
}
-class _ExternalUint32Array extends _TypedList implements Uint32List {
+class _ExternalUint32Array extends _TypedList with _IntListMixin implements Uint32List {
// Factory constructors.
factory _ExternalUint32Array(int length) {
@@ -1781,11 +1797,7 @@
_setIndexedUint32(index, _toUint32(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1812,7 +1824,7 @@
}
-class _ExternalInt64Array extends _TypedList implements Int64List {
+class _ExternalInt64Array extends _TypedList with _IntListMixin implements Int64List {
// Factory constructors.
factory _ExternalInt64Array(int length) {
@@ -1836,11 +1848,7 @@
_setIndexedInt64(index, _toInt64(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1867,7 +1875,7 @@
}
-class _ExternalUint64Array extends _TypedList implements Uint64List {
+class _ExternalUint64Array extends _TypedList with _IntListMixin implements Uint64List {
// Factory constructors.
factory _ExternalUint64Array(int length) {
@@ -1891,11 +1899,7 @@
_setIndexedUint64(index, _toUint64(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1922,7 +1926,7 @@
}
-class _ExternalFloat32Array extends _TypedList implements Float32List {
+class _ExternalFloat32Array extends _TypedList with _DoubleListMixin implements Float32List {
// Factory constructors.
factory _ExternalFloat32Array(int length) {
@@ -1946,11 +1950,7 @@
_setIndexedFloat32(index, value);
}
- Iterator<double> get iterator {
- return new _TypedListIterator<double>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -1977,7 +1977,7 @@
}
-class _ExternalFloat64Array extends _TypedList implements Float64List {
+class _ExternalFloat64Array extends _TypedList with _DoubleListMixin implements Float64List {
// Factory constructors.
factory _ExternalFloat64Array(int length) {
@@ -2001,11 +2001,7 @@
_setIndexedFloat64(index, value);
}
- Iterator<double> get iterator {
- return new _TypedListIterator<double>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -2032,7 +2028,7 @@
}
-class _ExternalFloat32x4Array extends _TypedList implements Float32x4List {
+class _ExternalFloat32x4Array extends _TypedList with _Float32x4ListMixin implements Float32x4List {
// Factory constructors.
factory _ExternalFloat32x4Array(int length) {
@@ -2056,11 +2052,7 @@
_setIndexedFloat32x4(index, value);
}
- Iterator<Float32x4> get iterator {
- return new _TypedListIterator<Float32x4>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -2087,7 +2079,7 @@
}
-class _ExternalInt32x4Array extends _TypedList implements Int32x4List {
+class _ExternalInt32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4List {
// Factory constructors.
factory _ExternalInt32x4Array(int length) {
@@ -2111,11 +2103,7 @@
_setIndexedInt32x4(index, value);
}
- Iterator<Int32x4> get iterator {
- return new _TypedListIterator<Int32x4>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -2142,7 +2130,7 @@
}
-class _ExternalFloat64x2Array extends _TypedList implements Float64x2List {
+class _ExternalFloat64x2Array extends _TypedList with _Float64x2ListMixin implements Float64x2List {
// Factory constructors.
factory _ExternalFloat64x2Array(int length) {
@@ -2166,11 +2154,7 @@
_setIndexedFloat64x2(index, value);
}
- Iterator<Float64x2> get iterator {
- return new _TypedListIterator<Float64x2>(this);
- }
-
// Method(s) implementing the TypedData interface.
int get elementSizeInBytes {
@@ -2469,7 +2453,7 @@
}
-class _Int8ArrayView extends _TypedListView implements Int8List {
+class _Int8ArrayView extends _TypedListView with _IntListMixin implements Int8List {
// Constructor.
_Int8ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2500,11 +2484,7 @@
_toInt8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2520,7 +2500,7 @@
}
-class _Uint8ArrayView extends _TypedListView implements Uint8List {
+class _Uint8ArrayView extends _TypedListView with _IntListMixin implements Uint8List {
// Constructor.
_Uint8ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2551,11 +2531,7 @@
_toUint8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2571,7 +2547,7 @@
}
-class _Uint8ClampedArrayView extends _TypedListView implements Uint8ClampedList {
+class _Uint8ClampedArrayView extends _TypedListView with _IntListMixin implements Uint8ClampedList {
// Constructor.
_Uint8ClampedArrayView(ByteBuffer buffer,
[int _offsetInBytes = 0, int _length])
@@ -2603,11 +2579,7 @@
_toClampedUint8(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2623,7 +2595,7 @@
}
-class _Int16ArrayView extends _TypedListView implements Int16List {
+class _Int16ArrayView extends _TypedListView with _IntListMixin implements Int16List {
// Constructor.
_Int16ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2655,11 +2627,7 @@
_toInt16(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2675,7 +2643,7 @@
}
-class _Uint16ArrayView extends _TypedListView implements Uint16List {
+class _Uint16ArrayView extends _TypedListView with _IntListMixin implements Uint16List {
// Constructor.
_Uint16ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2707,11 +2675,7 @@
_toUint16(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2727,7 +2691,7 @@
}
-class _Int32ArrayView extends _TypedListView implements Int32List {
+class _Int32ArrayView extends _TypedListView with _IntListMixin implements Int32List {
// Constructor.
_Int32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2759,11 +2723,7 @@
_toInt32(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2779,7 +2739,7 @@
}
-class _Uint32ArrayView extends _TypedListView implements Uint32List {
+class _Uint32ArrayView extends _TypedListView with _IntListMixin implements Uint32List {
// Constructor.
_Uint32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2811,11 +2771,7 @@
_toUint32(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2831,7 +2787,7 @@
}
-class _Int64ArrayView extends _TypedListView implements Int64List {
+class _Int64ArrayView extends _TypedListView with _IntListMixin implements Int64List {
// Constructor.
_Int64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2863,11 +2819,7 @@
_toInt64(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2883,7 +2835,7 @@
}
-class _Uint64ArrayView extends _TypedListView implements Uint64List {
+class _Uint64ArrayView extends _TypedListView with _IntListMixin implements Uint64List {
// Constructor.
_Uint64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2915,11 +2867,7 @@
_toUint64(value));
}
- Iterator<int> get iterator {
- return new _TypedListIterator<int>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2935,7 +2883,7 @@
}
-class _Float32ArrayView extends _TypedListView implements Float32List {
+class _Float32ArrayView extends _TypedListView with _DoubleListMixin implements Float32List {
// Constructor.
_Float32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -2967,11 +2915,7 @@
(index * Float32List.BYTES_PER_ELEMENT), value);
}
- Iterator<double> get iterator {
- return new _TypedListIterator<double>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -2987,7 +2931,7 @@
}
-class _Float64ArrayView extends _TypedListView implements Float64List {
+class _Float64ArrayView extends _TypedListView with _DoubleListMixin implements Float64List {
// Constructor.
_Float64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -3019,11 +2963,7 @@
(index * Float64List.BYTES_PER_ELEMENT), value);
}
- Iterator<double> get iterator {
- return new _TypedListIterator<double>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -3039,7 +2979,7 @@
}
-class _Float32x4ArrayView extends _TypedListView implements Float32x4List {
+class _Float32x4ArrayView extends _TypedListView with _Float32x4ListMixin implements Float32x4List {
// Constructor.
_Float32x4ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -3071,11 +3011,7 @@
(index * Float32x4List.BYTES_PER_ELEMENT), value);
}
- Iterator<Float32x4> get iterator {
- return new _TypedListIterator<Float32x4>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -3091,7 +3027,7 @@
}
-class _Int32x4ArrayView extends _TypedListView implements Int32x4List {
+class _Int32x4ArrayView extends _TypedListView with _Int32x4ListMixin implements Int32x4List {
// Constructor.
_Int32x4ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -3123,11 +3059,7 @@
(index * Int32x4List.BYTES_PER_ELEMENT), value);
}
- Iterator<Int32x4> get iterator {
- return new _TypedListIterator<Int32x4>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
@@ -3143,7 +3075,7 @@
}
-class _Float64x2ArrayView extends _TypedListView implements Float64x2List {
+class _Float64x2ArrayView extends _TypedListView with _Float64x2ListMixin implements Float64x2List {
// Constructor.
_Float64x2ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
: super(buffer, _offsetInBytes,
@@ -3175,11 +3107,7 @@
(index * Float64x2List.BYTES_PER_ELEMENT), value);
}
- Iterator<Float64x2> get iterator {
- return new _TypedListIterator<Float64x2>(this);
- }
-
// Method(s) implementing TypedData interface.
int get elementSizeInBytes {
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698