| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 classes for Int8List ..... Float64List and ByteData implementations. | 5 // patch classes for Int8List ..... Float64List and ByteData implementations. |
| 6 | 6 |
| 7 import "dart:_internal"; | 7 import "dart:_internal"; |
| 8 import 'dart:math' show Random; | 8 import 'dart:math' show Random; |
| 9 | 9 |
| 10 patch class Int8List { | 10 patch class Int8List { |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 int length = end - start; | 417 int length = end - start; |
| 418 _rangeCheck(this.length, start, length); | 418 _rangeCheck(this.length, start, length); |
| 419 List result = _createList(length); | 419 List result = _createList(length); |
| 420 result.setRange(0, length, this, start); | 420 result.setRange(0, length, this, start); |
| 421 return result; | 421 return result; |
| 422 } | 422 } |
| 423 | 423 |
| 424 void setRange(int start, int end, Iterable from, [int skipCount = 0]) { | 424 void setRange(int start, int end, Iterable from, [int skipCount = 0]) { |
| 425 // Check ranges. | 425 // Check ranges. |
| 426 if ((start < 0) || (start > length)) { | 426 if ((start < 0) || (start > length)) { |
| 427 _throwRangeError(start, length + 1); | 427 throw _newRangeError(start, length + 1); |
| 428 } | 428 } |
| 429 if ((end < 0) || (end > length)) { | 429 if ((end < 0) || (end > length)) { |
| 430 _throwRangeError(end, length + 1); | 430 throw _newRangeError(end, length + 1); |
| 431 } | 431 } |
| 432 if (start > end) { | 432 if (start > end) { |
| 433 _throwRangeError(start, end + 1); | 433 throw _newRangeError(start, end + 1); |
| 434 } | 434 } |
| 435 if (skipCount < 0) { | 435 if (skipCount < 0) { |
| 436 throw new ArgumentError(skipCount); | 436 throw new ArgumentError(skipCount); |
| 437 } | 437 } |
| 438 | 438 |
| 439 final count = end - start; | 439 final count = end - start; |
| 440 if ((from.length - skipCount) < count) { | 440 if ((from.length - skipCount) < count) { |
| 441 throw new StateError("Not enough elements"); | 441 throw new StateError("Not enough elements"); |
| 442 } | 442 } |
| 443 | 443 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 | 837 |
| 838 factory _Int8Array(int length) { | 838 factory _Int8Array(int length) { |
| 839 return _new(length); | 839 return _new(length); |
| 840 } | 840 } |
| 841 | 841 |
| 842 | 842 |
| 843 // Method(s) implementing List interface. | 843 // Method(s) implementing List interface. |
| 844 | 844 |
| 845 int operator[](int index) { | 845 int operator[](int index) { |
| 846 if (index < 0 || index >= length) { | 846 if (index < 0 || index >= length) { |
| 847 _throwRangeError(index, length); | 847 throw _newRangeError(index, length); |
| 848 } | 848 } |
| 849 return _getInt8(index); | 849 return _getInt8(index); |
| 850 } | 850 } |
| 851 | 851 |
| 852 void operator[]=(int index, int value) { | 852 void operator[]=(int index, int value) { |
| 853 if (index < 0 || index >= length) { | 853 if (index < 0 || index >= length) { |
| 854 _throwRangeError(index, length); | 854 throw _newRangeError(index, length); |
| 855 } | 855 } |
| 856 _setInt8(index, _toInt8(value)); | 856 _setInt8(index, _toInt8(value)); |
| 857 } | 857 } |
| 858 | 858 |
| 859 | 859 |
| 860 // Method(s) implementing TypedData interface. | 860 // Method(s) implementing TypedData interface. |
| 861 | 861 |
| 862 int get elementSizeInBytes { | 862 int get elementSizeInBytes { |
| 863 return Int8List.BYTES_PER_ELEMENT; | 863 return Int8List.BYTES_PER_ELEMENT; |
| 864 } | 864 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 878 // Factory constructors. | 878 // Factory constructors. |
| 879 | 879 |
| 880 factory _Uint8Array(int length) { | 880 factory _Uint8Array(int length) { |
| 881 return _new(length); | 881 return _new(length); |
| 882 } | 882 } |
| 883 | 883 |
| 884 | 884 |
| 885 // Methods implementing List interface. | 885 // Methods implementing List interface. |
| 886 int operator[](int index) { | 886 int operator[](int index) { |
| 887 if (index < 0 || index >= length) { | 887 if (index < 0 || index >= length) { |
| 888 _throwRangeError(index, length); | 888 throw _newRangeError(index, length); |
| 889 } | 889 } |
| 890 return _getUint8(index); | 890 return _getUint8(index); |
| 891 } | 891 } |
| 892 | 892 |
| 893 void operator[]=(int index, int value) { | 893 void operator[]=(int index, int value) { |
| 894 if (index < 0 || index >= length) { | 894 if (index < 0 || index >= length) { |
| 895 _throwRangeError(index, length); | 895 throw _newRangeError(index, length); |
| 896 } | 896 } |
| 897 _setUint8(index, _toUint8(value)); | 897 _setUint8(index, _toUint8(value)); |
| 898 } | 898 } |
| 899 | 899 |
| 900 | 900 |
| 901 // Methods implementing TypedData interface. | 901 // Methods implementing TypedData interface. |
| 902 int get elementSizeInBytes { | 902 int get elementSizeInBytes { |
| 903 return Uint8List.BYTES_PER_ELEMENT; | 903 return Uint8List.BYTES_PER_ELEMENT; |
| 904 } | 904 } |
| 905 | 905 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 918 // Factory constructors. | 918 // Factory constructors. |
| 919 | 919 |
| 920 factory _Uint8ClampedArray(int length) { | 920 factory _Uint8ClampedArray(int length) { |
| 921 return _new(length); | 921 return _new(length); |
| 922 } | 922 } |
| 923 | 923 |
| 924 // Methods implementing List interface. | 924 // Methods implementing List interface. |
| 925 | 925 |
| 926 int operator[](int index) { | 926 int operator[](int index) { |
| 927 if (index < 0 || index >= length) { | 927 if (index < 0 || index >= length) { |
| 928 _throwRangeError(index, length); | 928 throw _newRangeError(index, length); |
| 929 } | 929 } |
| 930 return _getUint8(index); | 930 return _getUint8(index); |
| 931 } | 931 } |
| 932 | 932 |
| 933 void operator[]=(int index, int value) { | 933 void operator[]=(int index, int value) { |
| 934 if (index < 0 || index >= length) { | 934 if (index < 0 || index >= length) { |
| 935 _throwRangeError(index, length); | 935 throw _newRangeError(index, length); |
| 936 } | 936 } |
| 937 _setUint8(index, _toClampedUint8(value)); | 937 _setUint8(index, _toClampedUint8(value)); |
| 938 } | 938 } |
| 939 | 939 |
| 940 | 940 |
| 941 // Methods implementing TypedData interface. | 941 // Methods implementing TypedData interface. |
| 942 int get elementSizeInBytes { | 942 int get elementSizeInBytes { |
| 943 return Uint8List.BYTES_PER_ELEMENT; | 943 return Uint8List.BYTES_PER_ELEMENT; |
| 944 } | 944 } |
| 945 | 945 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 960 | 960 |
| 961 factory _Int16Array(int length) { | 961 factory _Int16Array(int length) { |
| 962 return _new(length); | 962 return _new(length); |
| 963 } | 963 } |
| 964 | 964 |
| 965 | 965 |
| 966 // Method(s) implementing List interface. | 966 // Method(s) implementing List interface. |
| 967 | 967 |
| 968 int operator[](int index) { | 968 int operator[](int index) { |
| 969 if (index < 0 || index >= length) { | 969 if (index < 0 || index >= length) { |
| 970 _throwRangeError(index, length); | 970 throw _newRangeError(index, length); |
| 971 } | 971 } |
| 972 return _getIndexedInt16(index); | 972 return _getIndexedInt16(index); |
| 973 } | 973 } |
| 974 | 974 |
| 975 void operator[]=(int index, int value) { | 975 void operator[]=(int index, int value) { |
| 976 if (index < 0 || index >= length) { | 976 if (index < 0 || index >= length) { |
| 977 _throwRangeError(index, length); | 977 throw _newRangeError(index, length); |
| 978 } | 978 } |
| 979 _setIndexedInt16(index, _toInt16(value)); | 979 _setIndexedInt16(index, _toInt16(value)); |
| 980 } | 980 } |
| 981 | 981 |
| 982 | 982 |
| 983 // Method(s) implementing TypedData interface. | 983 // Method(s) implementing TypedData interface. |
| 984 | 984 |
| 985 int get elementSizeInBytes { | 985 int get elementSizeInBytes { |
| 986 return Int16List.BYTES_PER_ELEMENT; | 986 return Int16List.BYTES_PER_ELEMENT; |
| 987 } | 987 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1010 | 1010 |
| 1011 factory _Uint16Array(int length) { | 1011 factory _Uint16Array(int length) { |
| 1012 return _new(length); | 1012 return _new(length); |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 | 1015 |
| 1016 // Method(s) implementing the List interface. | 1016 // Method(s) implementing the List interface. |
| 1017 | 1017 |
| 1018 int operator[](int index) { | 1018 int operator[](int index) { |
| 1019 if (index < 0 || index >= length) { | 1019 if (index < 0 || index >= length) { |
| 1020 _throwRangeError(index, length); | 1020 throw _newRangeError(index, length); |
| 1021 } | 1021 } |
| 1022 return _getIndexedUint16(index); | 1022 return _getIndexedUint16(index); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 void operator[]=(int index, int value) { | 1025 void operator[]=(int index, int value) { |
| 1026 if (index < 0 || index >= length) { | 1026 if (index < 0 || index >= length) { |
| 1027 _throwRangeError(index, length); | 1027 throw _newRangeError(index, length); |
| 1028 } | 1028 } |
| 1029 _setIndexedUint16(index, _toUint16(value)); | 1029 _setIndexedUint16(index, _toUint16(value)); |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 | 1032 |
| 1033 // Method(s) implementing the TypedData interface. | 1033 // Method(s) implementing the TypedData interface. |
| 1034 | 1034 |
| 1035 int get elementSizeInBytes { | 1035 int get elementSizeInBytes { |
| 1036 return Uint16List.BYTES_PER_ELEMENT; | 1036 return Uint16List.BYTES_PER_ELEMENT; |
| 1037 } | 1037 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1060 | 1060 |
| 1061 factory _Int32Array(int length) { | 1061 factory _Int32Array(int length) { |
| 1062 return _new(length); | 1062 return _new(length); |
| 1063 } | 1063 } |
| 1064 | 1064 |
| 1065 | 1065 |
| 1066 // Method(s) implementing the List interface. | 1066 // Method(s) implementing the List interface. |
| 1067 | 1067 |
| 1068 int operator[](int index) { | 1068 int operator[](int index) { |
| 1069 if (index < 0 || index >= length) { | 1069 if (index < 0 || index >= length) { |
| 1070 _throwRangeError(index, length); | 1070 throw _newRangeError(index, length); |
| 1071 } | 1071 } |
| 1072 return _getIndexedInt32(index); | 1072 return _getIndexedInt32(index); |
| 1073 } | 1073 } |
| 1074 | 1074 |
| 1075 void operator[]=(int index, int value) { | 1075 void operator[]=(int index, int value) { |
| 1076 if (index < 0 || index >= length) { | 1076 if (index < 0 || index >= length) { |
| 1077 _throwRangeError(index, length); | 1077 throw _newRangeError(index, length); |
| 1078 } | 1078 } |
| 1079 _setIndexedInt32(index, _toInt32(value)); | 1079 _setIndexedInt32(index, _toInt32(value)); |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 | 1082 |
| 1083 // Method(s) implementing TypedData interface. | 1083 // Method(s) implementing TypedData interface. |
| 1084 | 1084 |
| 1085 int get elementSizeInBytes { | 1085 int get elementSizeInBytes { |
| 1086 return Int32List.BYTES_PER_ELEMENT; | 1086 return Int32List.BYTES_PER_ELEMENT; |
| 1087 } | 1087 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1110 | 1110 |
| 1111 factory _Uint32Array(int length) { | 1111 factory _Uint32Array(int length) { |
| 1112 return _new(length); | 1112 return _new(length); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 | 1115 |
| 1116 // Method(s) implementing the List interface. | 1116 // Method(s) implementing the List interface. |
| 1117 | 1117 |
| 1118 int operator[](int index) { | 1118 int operator[](int index) { |
| 1119 if (index < 0 || index >= length) { | 1119 if (index < 0 || index >= length) { |
| 1120 _throwRangeError(index, length); | 1120 throw _newRangeError(index, length); |
| 1121 } | 1121 } |
| 1122 return _getIndexedUint32(index); | 1122 return _getIndexedUint32(index); |
| 1123 } | 1123 } |
| 1124 | 1124 |
| 1125 void operator[]=(int index, int value) { | 1125 void operator[]=(int index, int value) { |
| 1126 if (index < 0 || index >= length) { | 1126 if (index < 0 || index >= length) { |
| 1127 _throwRangeError(index, length); | 1127 throw _newRangeError(index, length); |
| 1128 } | 1128 } |
| 1129 _setIndexedUint32(index, _toUint32(value)); | 1129 _setIndexedUint32(index, _toUint32(value)); |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 | 1132 |
| 1133 // Method(s) implementing the TypedData interface. | 1133 // Method(s) implementing the TypedData interface. |
| 1134 | 1134 |
| 1135 int get elementSizeInBytes { | 1135 int get elementSizeInBytes { |
| 1136 return Uint32List.BYTES_PER_ELEMENT; | 1136 return Uint32List.BYTES_PER_ELEMENT; |
| 1137 } | 1137 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1160 | 1160 |
| 1161 factory _Int64Array(int length) { | 1161 factory _Int64Array(int length) { |
| 1162 return _new(length); | 1162 return _new(length); |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 | 1165 |
| 1166 // Method(s) implementing the List interface. | 1166 // Method(s) implementing the List interface. |
| 1167 | 1167 |
| 1168 int operator[](int index) { | 1168 int operator[](int index) { |
| 1169 if (index < 0 || index >= length) { | 1169 if (index < 0 || index >= length) { |
| 1170 _throwRangeError(index, length); | 1170 throw _newRangeError(index, length); |
| 1171 } | 1171 } |
| 1172 return _getIndexedInt64(index); | 1172 return _getIndexedInt64(index); |
| 1173 } | 1173 } |
| 1174 | 1174 |
| 1175 void operator[]=(int index, int value) { | 1175 void operator[]=(int index, int value) { |
| 1176 if (index < 0 || index >= length) { | 1176 if (index < 0 || index >= length) { |
| 1177 _throwRangeError(index, length); | 1177 throw _newRangeError(index, length); |
| 1178 } | 1178 } |
| 1179 _setIndexedInt64(index, _toInt64(value)); | 1179 _setIndexedInt64(index, _toInt64(value)); |
| 1180 } | 1180 } |
| 1181 | 1181 |
| 1182 | 1182 |
| 1183 // Method(s) implementing the TypedData interface. | 1183 // Method(s) implementing the TypedData interface. |
| 1184 | 1184 |
| 1185 int get elementSizeInBytes { | 1185 int get elementSizeInBytes { |
| 1186 return Int64List.BYTES_PER_ELEMENT; | 1186 return Int64List.BYTES_PER_ELEMENT; |
| 1187 } | 1187 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1210 | 1210 |
| 1211 factory _Uint64Array(int length) { | 1211 factory _Uint64Array(int length) { |
| 1212 return _new(length); | 1212 return _new(length); |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 | 1215 |
| 1216 // Method(s) implementing the List interface. | 1216 // Method(s) implementing the List interface. |
| 1217 | 1217 |
| 1218 int operator[](int index) { | 1218 int operator[](int index) { |
| 1219 if (index < 0 || index >= length) { | 1219 if (index < 0 || index >= length) { |
| 1220 _throwRangeError(index, length); | 1220 throw _newRangeError(index, length); |
| 1221 } | 1221 } |
| 1222 return _getIndexedUint64(index); | 1222 return _getIndexedUint64(index); |
| 1223 } | 1223 } |
| 1224 | 1224 |
| 1225 void operator[]=(int index, int value) { | 1225 void operator[]=(int index, int value) { |
| 1226 if (index < 0 || index >= length) { | 1226 if (index < 0 || index >= length) { |
| 1227 _throwRangeError(index, length); | 1227 throw _newRangeError(index, length); |
| 1228 } | 1228 } |
| 1229 _setIndexedUint64(index, _toUint64(value)); | 1229 _setIndexedUint64(index, _toUint64(value)); |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 | 1232 |
| 1233 // Method(s) implementing the TypedData interface. | 1233 // Method(s) implementing the TypedData interface. |
| 1234 | 1234 |
| 1235 int get elementSizeInBytes { | 1235 int get elementSizeInBytes { |
| 1236 return Uint64List.BYTES_PER_ELEMENT; | 1236 return Uint64List.BYTES_PER_ELEMENT; |
| 1237 } | 1237 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1260 | 1260 |
| 1261 factory _Float32Array(int length) { | 1261 factory _Float32Array(int length) { |
| 1262 return _new(length); | 1262 return _new(length); |
| 1263 } | 1263 } |
| 1264 | 1264 |
| 1265 | 1265 |
| 1266 // Method(s) implementing the List interface. | 1266 // Method(s) implementing the List interface. |
| 1267 | 1267 |
| 1268 double operator[](int index) { | 1268 double operator[](int index) { |
| 1269 if (index < 0 || index >= length) { | 1269 if (index < 0 || index >= length) { |
| 1270 _throwRangeError(index, length); | 1270 throw _newRangeError(index, length); |
| 1271 } | 1271 } |
| 1272 return _getIndexedFloat32(index); | 1272 return _getIndexedFloat32(index); |
| 1273 } | 1273 } |
| 1274 | 1274 |
| 1275 void operator[]=(int index, double value) { | 1275 void operator[]=(int index, double value) { |
| 1276 if (index < 0 || index >= length) { | 1276 if (index < 0 || index >= length) { |
| 1277 _throwRangeError(index, length); | 1277 throw _newRangeError(index, length); |
| 1278 } | 1278 } |
| 1279 _setIndexedFloat32(index, value); | 1279 _setIndexedFloat32(index, value); |
| 1280 } | 1280 } |
| 1281 | 1281 |
| 1282 | 1282 |
| 1283 // Method(s) implementing the TypedData interface. | 1283 // Method(s) implementing the TypedData interface. |
| 1284 | 1284 |
| 1285 int get elementSizeInBytes { | 1285 int get elementSizeInBytes { |
| 1286 return Float32List.BYTES_PER_ELEMENT; | 1286 return Float32List.BYTES_PER_ELEMENT; |
| 1287 } | 1287 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1310 | 1310 |
| 1311 factory _Float64Array(int length) { | 1311 factory _Float64Array(int length) { |
| 1312 return _new(length); | 1312 return _new(length); |
| 1313 } | 1313 } |
| 1314 | 1314 |
| 1315 | 1315 |
| 1316 // Method(s) implementing the List interface. | 1316 // Method(s) implementing the List interface. |
| 1317 | 1317 |
| 1318 double operator[](int index) { | 1318 double operator[](int index) { |
| 1319 if (index < 0 || index >= length) { | 1319 if (index < 0 || index >= length) { |
| 1320 _throwRangeError(index, length); | 1320 throw _newRangeError(index, length); |
| 1321 } | 1321 } |
| 1322 return _getIndexedFloat64(index); | 1322 return _getIndexedFloat64(index); |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 void operator[]=(int index, double value) { | 1325 void operator[]=(int index, double value) { |
| 1326 if (index < 0 || index >= length) { | 1326 if (index < 0 || index >= length) { |
| 1327 _throwRangeError(index, length); | 1327 throw _newRangeError(index, length); |
| 1328 } | 1328 } |
| 1329 _setIndexedFloat64(index, value); | 1329 _setIndexedFloat64(index, value); |
| 1330 } | 1330 } |
| 1331 | 1331 |
| 1332 | 1332 |
| 1333 // Method(s) implementing the TypedData interface. | 1333 // Method(s) implementing the TypedData interface. |
| 1334 | 1334 |
| 1335 int get elementSizeInBytes { | 1335 int get elementSizeInBytes { |
| 1336 return Float64List.BYTES_PER_ELEMENT; | 1336 return Float64List.BYTES_PER_ELEMENT; |
| 1337 } | 1337 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1358 class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo
at32x4List { | 1358 class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo
at32x4List { |
| 1359 // Factory constructors. | 1359 // Factory constructors. |
| 1360 | 1360 |
| 1361 factory _Float32x4Array(int length) { | 1361 factory _Float32x4Array(int length) { |
| 1362 return _new(length); | 1362 return _new(length); |
| 1363 } | 1363 } |
| 1364 | 1364 |
| 1365 | 1365 |
| 1366 Float32x4 operator[](int index) { | 1366 Float32x4 operator[](int index) { |
| 1367 if (index < 0 || index >= length) { | 1367 if (index < 0 || index >= length) { |
| 1368 _throwRangeError(index, length); | 1368 throw _newRangeError(index, length); |
| 1369 } | 1369 } |
| 1370 return _getIndexedFloat32x4(index); | 1370 return _getIndexedFloat32x4(index); |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 void operator[]=(int index, Float32x4 value) { | 1373 void operator[]=(int index, Float32x4 value) { |
| 1374 if (index < 0 || index >= length) { | 1374 if (index < 0 || index >= length) { |
| 1375 _throwRangeError(index, length); | 1375 throw _newRangeError(index, length); |
| 1376 } | 1376 } |
| 1377 _setIndexedFloat32x4(index, value); | 1377 _setIndexedFloat32x4(index, value); |
| 1378 } | 1378 } |
| 1379 | 1379 |
| 1380 | 1380 |
| 1381 // Method(s) implementing the TypedData interface. | 1381 // Method(s) implementing the TypedData interface. |
| 1382 | 1382 |
| 1383 int get elementSizeInBytes { | 1383 int get elementSizeInBytes { |
| 1384 return Float32x4List.BYTES_PER_ELEMENT; | 1384 return Float32x4List.BYTES_PER_ELEMENT; |
| 1385 } | 1385 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1406 class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4
List { | 1406 class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4
List { |
| 1407 // Factory constructors. | 1407 // Factory constructors. |
| 1408 | 1408 |
| 1409 factory _Int32x4Array(int length) { | 1409 factory _Int32x4Array(int length) { |
| 1410 return _new(length); | 1410 return _new(length); |
| 1411 } | 1411 } |
| 1412 | 1412 |
| 1413 | 1413 |
| 1414 Int32x4 operator[](int index) { | 1414 Int32x4 operator[](int index) { |
| 1415 if (index < 0 || index >= length) { | 1415 if (index < 0 || index >= length) { |
| 1416 _throwRangeError(index, length); | 1416 throw _newRangeError(index, length); |
| 1417 } | 1417 } |
| 1418 return _getIndexedInt32x4(index); | 1418 return _getIndexedInt32x4(index); |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 void operator[]=(int index, Int32x4 value) { | 1421 void operator[]=(int index, Int32x4 value) { |
| 1422 if (index < 0 || index >= length) { | 1422 if (index < 0 || index >= length) { |
| 1423 _throwRangeError(index, length); | 1423 throw _newRangeError(index, length); |
| 1424 } | 1424 } |
| 1425 _setIndexedInt32x4(index, value); | 1425 _setIndexedInt32x4(index, value); |
| 1426 } | 1426 } |
| 1427 | 1427 |
| 1428 | 1428 |
| 1429 // Method(s) implementing the TypedData interface. | 1429 // Method(s) implementing the TypedData interface. |
| 1430 | 1430 |
| 1431 int get elementSizeInBytes { | 1431 int get elementSizeInBytes { |
| 1432 return Int32x4List.BYTES_PER_ELEMENT; | 1432 return Int32x4List.BYTES_PER_ELEMENT; |
| 1433 } | 1433 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1454 class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Flo
at64x2List { | 1454 class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Flo
at64x2List { |
| 1455 // Factory constructors. | 1455 // Factory constructors. |
| 1456 | 1456 |
| 1457 factory _Float64x2Array(int length) { | 1457 factory _Float64x2Array(int length) { |
| 1458 return _new(length); | 1458 return _new(length); |
| 1459 } | 1459 } |
| 1460 | 1460 |
| 1461 | 1461 |
| 1462 Float64x2 operator[](int index) { | 1462 Float64x2 operator[](int index) { |
| 1463 if (index < 0 || index >= length) { | 1463 if (index < 0 || index >= length) { |
| 1464 _throwRangeError(index, length); | 1464 throw _newRangeError(index, length); |
| 1465 } | 1465 } |
| 1466 return _getIndexedFloat64x2(index); | 1466 return _getIndexedFloat64x2(index); |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 void operator[]=(int index, Float64x2 value) { | 1469 void operator[]=(int index, Float64x2 value) { |
| 1470 if (index < 0 || index >= length) { | 1470 if (index < 0 || index >= length) { |
| 1471 _throwRangeError(index, length); | 1471 throw _newRangeError(index, length); |
| 1472 } | 1472 } |
| 1473 _setIndexedFloat64x2(index, value); | 1473 _setIndexedFloat64x2(index, value); |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 | 1476 |
| 1477 // Method(s) implementing the TypedData interface. | 1477 // Method(s) implementing the TypedData interface. |
| 1478 | 1478 |
| 1479 int get elementSizeInBytes { | 1479 int get elementSizeInBytes { |
| 1480 return Float64x2List.BYTES_PER_ELEMENT; | 1480 return Float64x2List.BYTES_PER_ELEMENT; |
| 1481 } | 1481 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1503 // Factory constructors. | 1503 // Factory constructors. |
| 1504 | 1504 |
| 1505 factory _ExternalInt8Array(int length) { | 1505 factory _ExternalInt8Array(int length) { |
| 1506 return _new(length); | 1506 return _new(length); |
| 1507 } | 1507 } |
| 1508 | 1508 |
| 1509 | 1509 |
| 1510 // Method(s) implementing the List interface. | 1510 // Method(s) implementing the List interface. |
| 1511 int operator[](int index) { | 1511 int operator[](int index) { |
| 1512 if (index < 0 || index >= length) { | 1512 if (index < 0 || index >= length) { |
| 1513 _throwRangeError(index, length); | 1513 throw _newRangeError(index, length); |
| 1514 } | 1514 } |
| 1515 return _getInt8(index); | 1515 return _getInt8(index); |
| 1516 } | 1516 } |
| 1517 | 1517 |
| 1518 void operator[]=(int index, int value) { | 1518 void operator[]=(int index, int value) { |
| 1519 if (index < 0 || index >= length) { | 1519 if (index < 0 || index >= length) { |
| 1520 _throwRangeError(index, length); | 1520 throw _newRangeError(index, length); |
| 1521 } | 1521 } |
| 1522 _setInt8(index, value); | 1522 _setInt8(index, value); |
| 1523 } | 1523 } |
| 1524 | 1524 |
| 1525 | 1525 |
| 1526 // Method(s) implementing the TypedData interface. | 1526 // Method(s) implementing the TypedData interface. |
| 1527 | 1527 |
| 1528 int get elementSizeInBytes { | 1528 int get elementSizeInBytes { |
| 1529 return Int8List.BYTES_PER_ELEMENT; | 1529 return Int8List.BYTES_PER_ELEMENT; |
| 1530 } | 1530 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1546 | 1546 |
| 1547 factory _ExternalUint8Array(int length) { | 1547 factory _ExternalUint8Array(int length) { |
| 1548 return _new(length); | 1548 return _new(length); |
| 1549 } | 1549 } |
| 1550 | 1550 |
| 1551 | 1551 |
| 1552 // Method(s) implementing the List interface. | 1552 // Method(s) implementing the List interface. |
| 1553 | 1553 |
| 1554 int operator[](int index) { | 1554 int operator[](int index) { |
| 1555 if (index < 0 || index >= length) { | 1555 if (index < 0 || index >= length) { |
| 1556 _throwRangeError(index, length); | 1556 throw _newRangeError(index, length); |
| 1557 } | 1557 } |
| 1558 return _getUint8(index); | 1558 return _getUint8(index); |
| 1559 } | 1559 } |
| 1560 | 1560 |
| 1561 void operator[]=(int index, int value) { | 1561 void operator[]=(int index, int value) { |
| 1562 if (index < 0 || index >= length) { | 1562 if (index < 0 || index >= length) { |
| 1563 _throwRangeError(index, length); | 1563 throw _newRangeError(index, length); |
| 1564 } | 1564 } |
| 1565 _setUint8(index, _toUint8(value)); | 1565 _setUint8(index, _toUint8(value)); |
| 1566 } | 1566 } |
| 1567 | 1567 |
| 1568 | 1568 |
| 1569 // Method(s) implementing the TypedData interface. | 1569 // Method(s) implementing the TypedData interface. |
| 1570 | 1570 |
| 1571 int get elementSizeInBytes { | 1571 int get elementSizeInBytes { |
| 1572 return Uint8List.BYTES_PER_ELEMENT; | 1572 return Uint8List.BYTES_PER_ELEMENT; |
| 1573 } | 1573 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1588 // Factory constructors. | 1588 // Factory constructors. |
| 1589 | 1589 |
| 1590 factory _ExternalUint8ClampedArray(int length) { | 1590 factory _ExternalUint8ClampedArray(int length) { |
| 1591 return _new(length); | 1591 return _new(length); |
| 1592 } | 1592 } |
| 1593 | 1593 |
| 1594 // Method(s) implementing the List interface. | 1594 // Method(s) implementing the List interface. |
| 1595 | 1595 |
| 1596 int operator[](int index) { | 1596 int operator[](int index) { |
| 1597 if (index < 0 || index >= length) { | 1597 if (index < 0 || index >= length) { |
| 1598 _throwRangeError(index, length); | 1598 throw _newRangeError(index, length); |
| 1599 } | 1599 } |
| 1600 return _getUint8(index); | 1600 return _getUint8(index); |
| 1601 } | 1601 } |
| 1602 | 1602 |
| 1603 void operator[]=(int index, int value) { | 1603 void operator[]=(int index, int value) { |
| 1604 if (index < 0 || index >= length) { | 1604 if (index < 0 || index >= length) { |
| 1605 _throwRangeError(index, length); | 1605 throw _newRangeError(index, length); |
| 1606 } | 1606 } |
| 1607 _setUint8(index, _toClampedUint8(value)); | 1607 _setUint8(index, _toClampedUint8(value)); |
| 1608 } | 1608 } |
| 1609 | 1609 |
| 1610 | 1610 |
| 1611 // Method(s) implementing the TypedData interface. | 1611 // Method(s) implementing the TypedData interface. |
| 1612 | 1612 |
| 1613 int get elementSizeInBytes { | 1613 int get elementSizeInBytes { |
| 1614 return Uint8List.BYTES_PER_ELEMENT; | 1614 return Uint8List.BYTES_PER_ELEMENT; |
| 1615 } | 1615 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1631 | 1631 |
| 1632 factory _ExternalInt16Array(int length) { | 1632 factory _ExternalInt16Array(int length) { |
| 1633 return _new(length); | 1633 return _new(length); |
| 1634 } | 1634 } |
| 1635 | 1635 |
| 1636 | 1636 |
| 1637 // Method(s) implementing the List interface. | 1637 // Method(s) implementing the List interface. |
| 1638 | 1638 |
| 1639 int operator[](int index) { | 1639 int operator[](int index) { |
| 1640 if (index < 0 || index >= length) { | 1640 if (index < 0 || index >= length) { |
| 1641 _throwRangeError(index, length); | 1641 throw _newRangeError(index, length); |
| 1642 } | 1642 } |
| 1643 return _getIndexedInt16(index); | 1643 return _getIndexedInt16(index); |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 void operator[]=(int index, int value) { | 1646 void operator[]=(int index, int value) { |
| 1647 if (index < 0 || index >= length) { | 1647 if (index < 0 || index >= length) { |
| 1648 _throwRangeError(index, length); | 1648 throw _newRangeError(index, length); |
| 1649 } | 1649 } |
| 1650 _setIndexedInt16(index, _toInt16(value)); | 1650 _setIndexedInt16(index, _toInt16(value)); |
| 1651 } | 1651 } |
| 1652 | 1652 |
| 1653 | 1653 |
| 1654 // Method(s) implementing the TypedData interface. | 1654 // Method(s) implementing the TypedData interface. |
| 1655 | 1655 |
| 1656 int get elementSizeInBytes { | 1656 int get elementSizeInBytes { |
| 1657 return Int16List.BYTES_PER_ELEMENT; | 1657 return Int16List.BYTES_PER_ELEMENT; |
| 1658 } | 1658 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1682 | 1682 |
| 1683 factory _ExternalUint16Array(int length) { | 1683 factory _ExternalUint16Array(int length) { |
| 1684 return _new(length); | 1684 return _new(length); |
| 1685 } | 1685 } |
| 1686 | 1686 |
| 1687 | 1687 |
| 1688 // Method(s) implementing the List interface. | 1688 // Method(s) implementing the List interface. |
| 1689 | 1689 |
| 1690 int operator[](int index) { | 1690 int operator[](int index) { |
| 1691 if (index < 0 || index >= length) { | 1691 if (index < 0 || index >= length) { |
| 1692 _throwRangeError(index, length); | 1692 throw _newRangeError(index, length); |
| 1693 } | 1693 } |
| 1694 return _getIndexedUint16(index); | 1694 return _getIndexedUint16(index); |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 void operator[]=(int index, int value) { | 1697 void operator[]=(int index, int value) { |
| 1698 if (index < 0 || index >= length) { | 1698 if (index < 0 || index >= length) { |
| 1699 _throwRangeError(index, length); | 1699 throw _newRangeError(index, length); |
| 1700 } | 1700 } |
| 1701 _setIndexedUint16(index, _toUint16(value)); | 1701 _setIndexedUint16(index, _toUint16(value)); |
| 1702 } | 1702 } |
| 1703 | 1703 |
| 1704 | 1704 |
| 1705 // Method(s) implementing the TypedData interface. | 1705 // Method(s) implementing the TypedData interface. |
| 1706 | 1706 |
| 1707 int get elementSizeInBytes { | 1707 int get elementSizeInBytes { |
| 1708 return Uint16List.BYTES_PER_ELEMENT; | 1708 return Uint16List.BYTES_PER_ELEMENT; |
| 1709 } | 1709 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1733 | 1733 |
| 1734 factory _ExternalInt32Array(int length) { | 1734 factory _ExternalInt32Array(int length) { |
| 1735 return _new(length); | 1735 return _new(length); |
| 1736 } | 1736 } |
| 1737 | 1737 |
| 1738 | 1738 |
| 1739 // Method(s) implementing the List interface. | 1739 // Method(s) implementing the List interface. |
| 1740 | 1740 |
| 1741 int operator[](int index) { | 1741 int operator[](int index) { |
| 1742 if (index < 0 || index >= length) { | 1742 if (index < 0 || index >= length) { |
| 1743 _throwRangeError(index, length); | 1743 throw _newRangeError(index, length); |
| 1744 } | 1744 } |
| 1745 return _getIndexedInt32(index); | 1745 return _getIndexedInt32(index); |
| 1746 } | 1746 } |
| 1747 | 1747 |
| 1748 void operator[]=(int index, int value) { | 1748 void operator[]=(int index, int value) { |
| 1749 if (index < 0 || index >= length) { | 1749 if (index < 0 || index >= length) { |
| 1750 _throwRangeError(index, length); | 1750 throw _newRangeError(index, length); |
| 1751 } | 1751 } |
| 1752 _setIndexedInt32(index, _toInt32(value)); | 1752 _setIndexedInt32(index, _toInt32(value)); |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 | 1755 |
| 1756 // Method(s) implementing the TypedData interface. | 1756 // Method(s) implementing the TypedData interface. |
| 1757 | 1757 |
| 1758 int get elementSizeInBytes { | 1758 int get elementSizeInBytes { |
| 1759 return Int32List.BYTES_PER_ELEMENT; | 1759 return Int32List.BYTES_PER_ELEMENT; |
| 1760 } | 1760 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1784 | 1784 |
| 1785 factory _ExternalUint32Array(int length) { | 1785 factory _ExternalUint32Array(int length) { |
| 1786 return _new(length); | 1786 return _new(length); |
| 1787 } | 1787 } |
| 1788 | 1788 |
| 1789 | 1789 |
| 1790 // Method(s) implementing the List interface. | 1790 // Method(s) implementing the List interface. |
| 1791 | 1791 |
| 1792 int operator[](int index) { | 1792 int operator[](int index) { |
| 1793 if (index < 0 || index >= length) { | 1793 if (index < 0 || index >= length) { |
| 1794 _throwRangeError(index, length); | 1794 throw _newRangeError(index, length); |
| 1795 } | 1795 } |
| 1796 return _getIndexedUint32(index); | 1796 return _getIndexedUint32(index); |
| 1797 } | 1797 } |
| 1798 | 1798 |
| 1799 void operator[]=(int index, int value) { | 1799 void operator[]=(int index, int value) { |
| 1800 if (index < 0 || index >= length) { | 1800 if (index < 0 || index >= length) { |
| 1801 _throwRangeError(index, length); | 1801 throw _newRangeError(index, length); |
| 1802 } | 1802 } |
| 1803 _setIndexedUint32(index, _toUint32(value)); | 1803 _setIndexedUint32(index, _toUint32(value)); |
| 1804 } | 1804 } |
| 1805 | 1805 |
| 1806 | 1806 |
| 1807 // Method(s) implementing the TypedData interface. | 1807 // Method(s) implementing the TypedData interface. |
| 1808 | 1808 |
| 1809 int get elementSizeInBytes { | 1809 int get elementSizeInBytes { |
| 1810 return Uint32List.BYTES_PER_ELEMENT; | 1810 return Uint32List.BYTES_PER_ELEMENT; |
| 1811 } | 1811 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1835 | 1835 |
| 1836 factory _ExternalInt64Array(int length) { | 1836 factory _ExternalInt64Array(int length) { |
| 1837 return _new(length); | 1837 return _new(length); |
| 1838 } | 1838 } |
| 1839 | 1839 |
| 1840 | 1840 |
| 1841 // Method(s) implementing the List interface. | 1841 // Method(s) implementing the List interface. |
| 1842 | 1842 |
| 1843 int operator[](int index) { | 1843 int operator[](int index) { |
| 1844 if (index < 0 || index >= length) { | 1844 if (index < 0 || index >= length) { |
| 1845 _throwRangeError(index, length); | 1845 throw _newRangeError(index, length); |
| 1846 } | 1846 } |
| 1847 return _getIndexedInt64(index); | 1847 return _getIndexedInt64(index); |
| 1848 } | 1848 } |
| 1849 | 1849 |
| 1850 void operator[]=(int index, int value) { | 1850 void operator[]=(int index, int value) { |
| 1851 if (index < 0 || index >= length) { | 1851 if (index < 0 || index >= length) { |
| 1852 _throwRangeError(index, length); | 1852 throw _newRangeError(index, length); |
| 1853 } | 1853 } |
| 1854 _setIndexedInt64(index, _toInt64(value)); | 1854 _setIndexedInt64(index, _toInt64(value)); |
| 1855 } | 1855 } |
| 1856 | 1856 |
| 1857 | 1857 |
| 1858 // Method(s) implementing the TypedData interface. | 1858 // Method(s) implementing the TypedData interface. |
| 1859 | 1859 |
| 1860 int get elementSizeInBytes { | 1860 int get elementSizeInBytes { |
| 1861 return Int64List.BYTES_PER_ELEMENT; | 1861 return Int64List.BYTES_PER_ELEMENT; |
| 1862 } | 1862 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1886 | 1886 |
| 1887 factory _ExternalUint64Array(int length) { | 1887 factory _ExternalUint64Array(int length) { |
| 1888 return _new(length); | 1888 return _new(length); |
| 1889 } | 1889 } |
| 1890 | 1890 |
| 1891 | 1891 |
| 1892 // Method(s) implementing the List interface. | 1892 // Method(s) implementing the List interface. |
| 1893 | 1893 |
| 1894 int operator[](int index) { | 1894 int operator[](int index) { |
| 1895 if (index < 0 || index >= length) { | 1895 if (index < 0 || index >= length) { |
| 1896 _throwRangeError(index, length); | 1896 throw _newRangeError(index, length); |
| 1897 } | 1897 } |
| 1898 return _getIndexedUint64(index); | 1898 return _getIndexedUint64(index); |
| 1899 } | 1899 } |
| 1900 | 1900 |
| 1901 void operator[]=(int index, int value) { | 1901 void operator[]=(int index, int value) { |
| 1902 if (index < 0 || index >= length) { | 1902 if (index < 0 || index >= length) { |
| 1903 _throwRangeError(index, length); | 1903 throw _newRangeError(index, length); |
| 1904 } | 1904 } |
| 1905 _setIndexedUint64(index, _toUint64(value)); | 1905 _setIndexedUint64(index, _toUint64(value)); |
| 1906 } | 1906 } |
| 1907 | 1907 |
| 1908 | 1908 |
| 1909 // Method(s) implementing the TypedData interface. | 1909 // Method(s) implementing the TypedData interface. |
| 1910 | 1910 |
| 1911 int get elementSizeInBytes { | 1911 int get elementSizeInBytes { |
| 1912 return Uint64List.BYTES_PER_ELEMENT; | 1912 return Uint64List.BYTES_PER_ELEMENT; |
| 1913 } | 1913 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1937 | 1937 |
| 1938 factory _ExternalFloat32Array(int length) { | 1938 factory _ExternalFloat32Array(int length) { |
| 1939 return _new(length); | 1939 return _new(length); |
| 1940 } | 1940 } |
| 1941 | 1941 |
| 1942 | 1942 |
| 1943 // Method(s) implementing the List interface. | 1943 // Method(s) implementing the List interface. |
| 1944 | 1944 |
| 1945 double operator[](int index) { | 1945 double operator[](int index) { |
| 1946 if (index < 0 || index >= length) { | 1946 if (index < 0 || index >= length) { |
| 1947 _throwRangeError(index, length); | 1947 throw _newRangeError(index, length); |
| 1948 } | 1948 } |
| 1949 return _getIndexedFloat32(index); | 1949 return _getIndexedFloat32(index); |
| 1950 } | 1950 } |
| 1951 | 1951 |
| 1952 void operator[]=(int index, double value) { | 1952 void operator[]=(int index, double value) { |
| 1953 if (index < 0 || index >= length) { | 1953 if (index < 0 || index >= length) { |
| 1954 _throwRangeError(index, length); | 1954 throw _newRangeError(index, length); |
| 1955 } | 1955 } |
| 1956 _setIndexedFloat32(index, value); | 1956 _setIndexedFloat32(index, value); |
| 1957 } | 1957 } |
| 1958 | 1958 |
| 1959 | 1959 |
| 1960 // Method(s) implementing the TypedData interface. | 1960 // Method(s) implementing the TypedData interface. |
| 1961 | 1961 |
| 1962 int get elementSizeInBytes { | 1962 int get elementSizeInBytes { |
| 1963 return Float32List.BYTES_PER_ELEMENT; | 1963 return Float32List.BYTES_PER_ELEMENT; |
| 1964 } | 1964 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1988 | 1988 |
| 1989 factory _ExternalFloat64Array(int length) { | 1989 factory _ExternalFloat64Array(int length) { |
| 1990 return _new(length); | 1990 return _new(length); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 | 1993 |
| 1994 // Method(s) implementing the List interface. | 1994 // Method(s) implementing the List interface. |
| 1995 | 1995 |
| 1996 double operator[](int index) { | 1996 double operator[](int index) { |
| 1997 if (index < 0 || index >= length) { | 1997 if (index < 0 || index >= length) { |
| 1998 _throwRangeError(index, length); | 1998 throw _newRangeError(index, length); |
| 1999 } | 1999 } |
| 2000 return _getIndexedFloat64(index); | 2000 return _getIndexedFloat64(index); |
| 2001 } | 2001 } |
| 2002 | 2002 |
| 2003 void operator[]=(int index, double value) { | 2003 void operator[]=(int index, double value) { |
| 2004 if (index < 0 || index >= length) { | 2004 if (index < 0 || index >= length) { |
| 2005 _throwRangeError(index, length); | 2005 throw _newRangeError(index, length); |
| 2006 } | 2006 } |
| 2007 _setIndexedFloat64(index, value); | 2007 _setIndexedFloat64(index, value); |
| 2008 } | 2008 } |
| 2009 | 2009 |
| 2010 | 2010 |
| 2011 // Method(s) implementing the TypedData interface. | 2011 // Method(s) implementing the TypedData interface. |
| 2012 | 2012 |
| 2013 int get elementSizeInBytes { | 2013 int get elementSizeInBytes { |
| 2014 return Float64List.BYTES_PER_ELEMENT; | 2014 return Float64List.BYTES_PER_ELEMENT; |
| 2015 } | 2015 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2039 | 2039 |
| 2040 factory _ExternalFloat32x4Array(int length) { | 2040 factory _ExternalFloat32x4Array(int length) { |
| 2041 return _new(length); | 2041 return _new(length); |
| 2042 } | 2042 } |
| 2043 | 2043 |
| 2044 | 2044 |
| 2045 // Method(s) implementing the List interface. | 2045 // Method(s) implementing the List interface. |
| 2046 | 2046 |
| 2047 Float32x4 operator[](int index) { | 2047 Float32x4 operator[](int index) { |
| 2048 if (index < 0 || index >= length) { | 2048 if (index < 0 || index >= length) { |
| 2049 _throwRangeError(index, length); | 2049 throw _newRangeError(index, length); |
| 2050 } | 2050 } |
| 2051 return _getIndexedFloat32x4(index); | 2051 return _getIndexedFloat32x4(index); |
| 2052 } | 2052 } |
| 2053 | 2053 |
| 2054 void operator[]=(int index, Float32x4 value) { | 2054 void operator[]=(int index, Float32x4 value) { |
| 2055 if (index < 0 || index >= length) { | 2055 if (index < 0 || index >= length) { |
| 2056 _throwRangeError(index, length); | 2056 throw _newRangeError(index, length); |
| 2057 } | 2057 } |
| 2058 _setIndexedFloat32x4(index, value); | 2058 _setIndexedFloat32x4(index, value); |
| 2059 } | 2059 } |
| 2060 | 2060 |
| 2061 | 2061 |
| 2062 // Method(s) implementing the TypedData interface. | 2062 // Method(s) implementing the TypedData interface. |
| 2063 | 2063 |
| 2064 int get elementSizeInBytes { | 2064 int get elementSizeInBytes { |
| 2065 return Float32x4List.BYTES_PER_ELEMENT; | 2065 return Float32x4List.BYTES_PER_ELEMENT; |
| 2066 } | 2066 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2090 | 2090 |
| 2091 factory _ExternalInt32x4Array(int length) { | 2091 factory _ExternalInt32x4Array(int length) { |
| 2092 return _new(length); | 2092 return _new(length); |
| 2093 } | 2093 } |
| 2094 | 2094 |
| 2095 | 2095 |
| 2096 // Method(s) implementing the List interface. | 2096 // Method(s) implementing the List interface. |
| 2097 | 2097 |
| 2098 Int32x4 operator[](int index) { | 2098 Int32x4 operator[](int index) { |
| 2099 if (index < 0 || index >= length) { | 2099 if (index < 0 || index >= length) { |
| 2100 _throwRangeError(index, length); | 2100 throw _newRangeError(index, length); |
| 2101 } | 2101 } |
| 2102 return _getIndexedInt32x4(index); | 2102 return _getIndexedInt32x4(index); |
| 2103 } | 2103 } |
| 2104 | 2104 |
| 2105 void operator[]=(int index, Int32x4 value) { | 2105 void operator[]=(int index, Int32x4 value) { |
| 2106 if (index < 0 || index >= length) { | 2106 if (index < 0 || index >= length) { |
| 2107 _throwRangeError(index, length); | 2107 throw _newRangeError(index, length); |
| 2108 } | 2108 } |
| 2109 _setIndexedInt32x4(index, value); | 2109 _setIndexedInt32x4(index, value); |
| 2110 } | 2110 } |
| 2111 | 2111 |
| 2112 | 2112 |
| 2113 // Method(s) implementing the TypedData interface. | 2113 // Method(s) implementing the TypedData interface. |
| 2114 | 2114 |
| 2115 int get elementSizeInBytes { | 2115 int get elementSizeInBytes { |
| 2116 return Int32x4List.BYTES_PER_ELEMENT; | 2116 return Int32x4List.BYTES_PER_ELEMENT; |
| 2117 } | 2117 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2141 | 2141 |
| 2142 factory _ExternalFloat64x2Array(int length) { | 2142 factory _ExternalFloat64x2Array(int length) { |
| 2143 return _new(length); | 2143 return _new(length); |
| 2144 } | 2144 } |
| 2145 | 2145 |
| 2146 | 2146 |
| 2147 // Method(s) implementing the List interface. | 2147 // Method(s) implementing the List interface. |
| 2148 | 2148 |
| 2149 Float64x2 operator[](int index) { | 2149 Float64x2 operator[](int index) { |
| 2150 if (index < 0 || index >= length) { | 2150 if (index < 0 || index >= length) { |
| 2151 _throwRangeError(index, length); | 2151 throw _newRangeError(index, length); |
| 2152 } | 2152 } |
| 2153 return _getIndexedFloat64x2(index); | 2153 return _getIndexedFloat64x2(index); |
| 2154 } | 2154 } |
| 2155 | 2155 |
| 2156 void operator[]=(int index, Float64x2 value) { | 2156 void operator[]=(int index, Float64x2 value) { |
| 2157 if (index < 0 || index >= length) { | 2157 if (index < 0 || index >= length) { |
| 2158 _throwRangeError(index, length); | 2158 throw _newRangeError(index, length); |
| 2159 } | 2159 } |
| 2160 _setIndexedFloat64x2(index, value); | 2160 _setIndexedFloat64x2(index, value); |
| 2161 } | 2161 } |
| 2162 | 2162 |
| 2163 | 2163 |
| 2164 // Method(s) implementing the TypedData interface. | 2164 // Method(s) implementing the TypedData interface. |
| 2165 | 2165 |
| 2166 int get elementSizeInBytes { | 2166 int get elementSizeInBytes { |
| 2167 return Float64x2List.BYTES_PER_ELEMENT; | 2167 return Float64x2List.BYTES_PER_ELEMENT; |
| 2168 } | 2168 } |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2469 _rangeCheck(buffer.lengthInBytes, | 2469 _rangeCheck(buffer.lengthInBytes, |
| 2470 _offsetInBytes, | 2470 _offsetInBytes, |
| 2471 length * Int8List.BYTES_PER_ELEMENT); | 2471 length * Int8List.BYTES_PER_ELEMENT); |
| 2472 } | 2472 } |
| 2473 | 2473 |
| 2474 | 2474 |
| 2475 // Method(s) implementing List interface. | 2475 // Method(s) implementing List interface. |
| 2476 | 2476 |
| 2477 int operator[](int index) { | 2477 int operator[](int index) { |
| 2478 if (index < 0 || index >= length) { | 2478 if (index < 0 || index >= length) { |
| 2479 _throwRangeError(index, length); | 2479 throw _newRangeError(index, length); |
| 2480 } | 2480 } |
| 2481 return _typedData._getInt8(offsetInBytes + | 2481 return _typedData._getInt8(offsetInBytes + |
| 2482 (index * Int8List.BYTES_PER_ELEMENT)); | 2482 (index * Int8List.BYTES_PER_ELEMENT)); |
| 2483 } | 2483 } |
| 2484 | 2484 |
| 2485 void operator[]=(int index, int value) { | 2485 void operator[]=(int index, int value) { |
| 2486 if (index < 0 || index >= length) { | 2486 if (index < 0 || index >= length) { |
| 2487 _throwRangeError(index, length); | 2487 throw _newRangeError(index, length); |
| 2488 } | 2488 } |
| 2489 _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT), | 2489 _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT), |
| 2490 _toInt8(value)); | 2490 _toInt8(value)); |
| 2491 } | 2491 } |
| 2492 | 2492 |
| 2493 | 2493 |
| 2494 // Method(s) implementing TypedData interface. | 2494 // Method(s) implementing TypedData interface. |
| 2495 | 2495 |
| 2496 int get elementSizeInBytes { | 2496 int get elementSizeInBytes { |
| 2497 return Int8List.BYTES_PER_ELEMENT; | 2497 return Int8List.BYTES_PER_ELEMENT; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2516 _rangeCheck(buffer.lengthInBytes, | 2516 _rangeCheck(buffer.lengthInBytes, |
| 2517 _offsetInBytes, | 2517 _offsetInBytes, |
| 2518 length * Uint8List.BYTES_PER_ELEMENT); | 2518 length * Uint8List.BYTES_PER_ELEMENT); |
| 2519 } | 2519 } |
| 2520 | 2520 |
| 2521 | 2521 |
| 2522 // Method(s) implementing List interface. | 2522 // Method(s) implementing List interface. |
| 2523 | 2523 |
| 2524 int operator[](int index) { | 2524 int operator[](int index) { |
| 2525 if (index < 0 || index >= length) { | 2525 if (index < 0 || index >= length) { |
| 2526 _throwRangeError(index, length); | 2526 throw _newRangeError(index, length); |
| 2527 |
| 2527 } | 2528 } |
| 2528 return _typedData._getUint8(offsetInBytes + | 2529 return _typedData._getUint8(offsetInBytes + |
| 2529 (index * Uint8List.BYTES_PER_ELEMENT)); | 2530 (index * Uint8List.BYTES_PER_ELEMENT)); |
| 2530 } | 2531 } |
| 2531 | 2532 |
| 2532 void operator[]=(int index, int value) { | 2533 void operator[]=(int index, int value) { |
| 2533 if (index < 0 || index >= length) { | 2534 if (index < 0 || index >= length) { |
| 2534 _throwRangeError(index, length); | 2535 throw _newRangeError(index, length); |
| 2535 } | 2536 } |
| 2536 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), | 2537 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), |
| 2537 _toUint8(value)); | 2538 _toUint8(value)); |
| 2538 } | 2539 } |
| 2539 | 2540 |
| 2540 | 2541 |
| 2541 // Method(s) implementing TypedData interface. | 2542 // Method(s) implementing TypedData interface. |
| 2542 | 2543 |
| 2543 int get elementSizeInBytes { | 2544 int get elementSizeInBytes { |
| 2544 return Uint8List.BYTES_PER_ELEMENT; | 2545 return Uint8List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2564 _rangeCheck(buffer.lengthInBytes, | 2565 _rangeCheck(buffer.lengthInBytes, |
| 2565 offsetInBytes, | 2566 offsetInBytes, |
| 2566 length * Uint8List.BYTES_PER_ELEMENT); | 2567 length * Uint8List.BYTES_PER_ELEMENT); |
| 2567 } | 2568 } |
| 2568 | 2569 |
| 2569 | 2570 |
| 2570 // Method(s) implementing List interface. | 2571 // Method(s) implementing List interface. |
| 2571 | 2572 |
| 2572 int operator[](int index) { | 2573 int operator[](int index) { |
| 2573 if (index < 0 || index >= length) { | 2574 if (index < 0 || index >= length) { |
| 2574 _throwRangeError(index, length); | 2575 throw _newRangeError(index, length); |
| 2575 } | 2576 } |
| 2576 return _typedData._getUint8(offsetInBytes + | 2577 return _typedData._getUint8(offsetInBytes + |
| 2577 (index * Uint8List.BYTES_PER_ELEMENT)); | 2578 (index * Uint8List.BYTES_PER_ELEMENT)); |
| 2578 } | 2579 } |
| 2579 | 2580 |
| 2580 void operator[]=(int index, int value) { | 2581 void operator[]=(int index, int value) { |
| 2581 if (index < 0 || index >= length) { | 2582 if (index < 0 || index >= length) { |
| 2582 _throwRangeError(index, length); | 2583 throw _newRangeError(index, length); |
| 2583 } | 2584 } |
| 2584 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), | 2585 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), |
| 2585 _toClampedUint8(value)); | 2586 _toClampedUint8(value)); |
| 2586 } | 2587 } |
| 2587 | 2588 |
| 2588 | 2589 |
| 2589 // Method(s) implementing TypedData interface. | 2590 // Method(s) implementing TypedData interface. |
| 2590 | 2591 |
| 2591 int get elementSizeInBytes { | 2592 int get elementSizeInBytes { |
| 2592 return Uint8List.BYTES_PER_ELEMENT; | 2593 return Uint8List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2612 offsetInBytes, | 2613 offsetInBytes, |
| 2613 length * Int16List.BYTES_PER_ELEMENT); | 2614 length * Int16List.BYTES_PER_ELEMENT); |
| 2614 _offsetAlignmentCheck(_offsetInBytes, Int16List.BYTES_PER_ELEMENT); | 2615 _offsetAlignmentCheck(_offsetInBytes, Int16List.BYTES_PER_ELEMENT); |
| 2615 } | 2616 } |
| 2616 | 2617 |
| 2617 | 2618 |
| 2618 // Method(s) implementing List interface. | 2619 // Method(s) implementing List interface. |
| 2619 | 2620 |
| 2620 int operator[](int index) { | 2621 int operator[](int index) { |
| 2621 if (index < 0 || index >= length) { | 2622 if (index < 0 || index >= length) { |
| 2622 _throwRangeError(index, length); | 2623 throw _newRangeError(index, length); |
| 2623 } | 2624 } |
| 2624 return _typedData._getInt16(offsetInBytes + | 2625 return _typedData._getInt16(offsetInBytes + |
| 2625 (index * Int16List.BYTES_PER_ELEMENT)); | 2626 (index * Int16List.BYTES_PER_ELEMENT)); |
| 2626 } | 2627 } |
| 2627 | 2628 |
| 2628 void operator[]=(int index, int value) { | 2629 void operator[]=(int index, int value) { |
| 2629 if (index < 0 || index >= length) { | 2630 if (index < 0 || index >= length) { |
| 2630 _throwRangeError(index, length); | 2631 throw _newRangeError(index, length); |
| 2631 } | 2632 } |
| 2632 _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT), | 2633 _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT), |
| 2633 _toInt16(value)); | 2634 _toInt16(value)); |
| 2634 } | 2635 } |
| 2635 | 2636 |
| 2636 | 2637 |
| 2637 // Method(s) implementing TypedData interface. | 2638 // Method(s) implementing TypedData interface. |
| 2638 | 2639 |
| 2639 int get elementSizeInBytes { | 2640 int get elementSizeInBytes { |
| 2640 return Int16List.BYTES_PER_ELEMENT; | 2641 return Int16List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2660 offsetInBytes, | 2661 offsetInBytes, |
| 2661 length * Uint16List.BYTES_PER_ELEMENT); | 2662 length * Uint16List.BYTES_PER_ELEMENT); |
| 2662 _offsetAlignmentCheck(_offsetInBytes, Uint16List.BYTES_PER_ELEMENT); | 2663 _offsetAlignmentCheck(_offsetInBytes, Uint16List.BYTES_PER_ELEMENT); |
| 2663 } | 2664 } |
| 2664 | 2665 |
| 2665 | 2666 |
| 2666 // Method(s) implementing List interface. | 2667 // Method(s) implementing List interface. |
| 2667 | 2668 |
| 2668 int operator[](int index) { | 2669 int operator[](int index) { |
| 2669 if (index < 0 || index >= length) { | 2670 if (index < 0 || index >= length) { |
| 2670 _throwRangeError(index, length); | 2671 throw _newRangeError(index, length); |
| 2671 } | 2672 } |
| 2672 return _typedData._getUint16(offsetInBytes + | 2673 return _typedData._getUint16(offsetInBytes + |
| 2673 (index * Uint16List.BYTES_PER_ELEMENT)); | 2674 (index * Uint16List.BYTES_PER_ELEMENT)); |
| 2674 } | 2675 } |
| 2675 | 2676 |
| 2676 void operator[]=(int index, int value) { | 2677 void operator[]=(int index, int value) { |
| 2677 if (index < 0 || index >= length) { | 2678 if (index < 0 || index >= length) { |
| 2678 _throwRangeError(index, length); | 2679 throw _newRangeError(index, length); |
| 2679 } | 2680 } |
| 2680 _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT)
, | 2681 _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT)
, |
| 2681 _toUint16(value)); | 2682 _toUint16(value)); |
| 2682 } | 2683 } |
| 2683 | 2684 |
| 2684 | 2685 |
| 2685 // Method(s) implementing TypedData interface. | 2686 // Method(s) implementing TypedData interface. |
| 2686 | 2687 |
| 2687 int get elementSizeInBytes { | 2688 int get elementSizeInBytes { |
| 2688 return Uint16List.BYTES_PER_ELEMENT; | 2689 return Uint16List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2708 offsetInBytes, | 2709 offsetInBytes, |
| 2709 length * Int32List.BYTES_PER_ELEMENT); | 2710 length * Int32List.BYTES_PER_ELEMENT); |
| 2710 _offsetAlignmentCheck(_offsetInBytes, Int32List.BYTES_PER_ELEMENT); | 2711 _offsetAlignmentCheck(_offsetInBytes, Int32List.BYTES_PER_ELEMENT); |
| 2711 } | 2712 } |
| 2712 | 2713 |
| 2713 | 2714 |
| 2714 // Method(s) implementing List interface. | 2715 // Method(s) implementing List interface. |
| 2715 | 2716 |
| 2716 int operator[](int index) { | 2717 int operator[](int index) { |
| 2717 if (index < 0 || index >= length) { | 2718 if (index < 0 || index >= length) { |
| 2718 _throwRangeError(index, length); | 2719 throw _newRangeError(index, length); |
| 2719 } | 2720 } |
| 2720 return _typedData._getInt32(offsetInBytes + | 2721 return _typedData._getInt32(offsetInBytes + |
| 2721 (index * Int32List.BYTES_PER_ELEMENT)); | 2722 (index * Int32List.BYTES_PER_ELEMENT)); |
| 2722 } | 2723 } |
| 2723 | 2724 |
| 2724 void operator[]=(int index, int value) { | 2725 void operator[]=(int index, int value) { |
| 2725 if (index < 0 || index >= length) { | 2726 if (index < 0 || index >= length) { |
| 2726 _throwRangeError(index, length); | 2727 throw _newRangeError(index, length); |
| 2727 } | 2728 } |
| 2728 _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT), | 2729 _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT), |
| 2729 _toInt32(value)); | 2730 _toInt32(value)); |
| 2730 } | 2731 } |
| 2731 | 2732 |
| 2732 | 2733 |
| 2733 // Method(s) implementing TypedData interface. | 2734 // Method(s) implementing TypedData interface. |
| 2734 | 2735 |
| 2735 int get elementSizeInBytes { | 2736 int get elementSizeInBytes { |
| 2736 return Int32List.BYTES_PER_ELEMENT; | 2737 return Int32List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2756 offsetInBytes, | 2757 offsetInBytes, |
| 2757 length * Uint32List.BYTES_PER_ELEMENT); | 2758 length * Uint32List.BYTES_PER_ELEMENT); |
| 2758 _offsetAlignmentCheck(_offsetInBytes, Uint32List.BYTES_PER_ELEMENT); | 2759 _offsetAlignmentCheck(_offsetInBytes, Uint32List.BYTES_PER_ELEMENT); |
| 2759 } | 2760 } |
| 2760 | 2761 |
| 2761 | 2762 |
| 2762 // Method(s) implementing List interface. | 2763 // Method(s) implementing List interface. |
| 2763 | 2764 |
| 2764 int operator[](int index) { | 2765 int operator[](int index) { |
| 2765 if (index < 0 || index >= length) { | 2766 if (index < 0 || index >= length) { |
| 2766 _throwRangeError(index, length); | 2767 throw _newRangeError(index, length); |
| 2767 } | 2768 } |
| 2768 return _typedData._getUint32(offsetInBytes + | 2769 return _typedData._getUint32(offsetInBytes + |
| 2769 (index * Uint32List.BYTES_PER_ELEMENT)); | 2770 (index * Uint32List.BYTES_PER_ELEMENT)); |
| 2770 } | 2771 } |
| 2771 | 2772 |
| 2772 void operator[]=(int index, int value) { | 2773 void operator[]=(int index, int value) { |
| 2773 if (index < 0 || index >= length) { | 2774 if (index < 0 || index >= length) { |
| 2774 _throwRangeError(index, length); | 2775 throw _newRangeError(index, length); |
| 2775 } | 2776 } |
| 2776 _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT)
, | 2777 _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT)
, |
| 2777 _toUint32(value)); | 2778 _toUint32(value)); |
| 2778 } | 2779 } |
| 2779 | 2780 |
| 2780 | 2781 |
| 2781 // Method(s) implementing TypedData interface. | 2782 // Method(s) implementing TypedData interface. |
| 2782 | 2783 |
| 2783 int get elementSizeInBytes { | 2784 int get elementSizeInBytes { |
| 2784 return Uint32List.BYTES_PER_ELEMENT; | 2785 return Uint32List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2804 offsetInBytes, | 2805 offsetInBytes, |
| 2805 length * Int64List.BYTES_PER_ELEMENT); | 2806 length * Int64List.BYTES_PER_ELEMENT); |
| 2806 _offsetAlignmentCheck(_offsetInBytes, Int64List.BYTES_PER_ELEMENT); | 2807 _offsetAlignmentCheck(_offsetInBytes, Int64List.BYTES_PER_ELEMENT); |
| 2807 } | 2808 } |
| 2808 | 2809 |
| 2809 | 2810 |
| 2810 // Method(s) implementing List interface. | 2811 // Method(s) implementing List interface. |
| 2811 | 2812 |
| 2812 int operator[](int index) { | 2813 int operator[](int index) { |
| 2813 if (index < 0 || index >= length) { | 2814 if (index < 0 || index >= length) { |
| 2814 _throwRangeError(index, length); | 2815 throw _newRangeError(index, length); |
| 2815 } | 2816 } |
| 2816 return _typedData._getInt64(offsetInBytes + | 2817 return _typedData._getInt64(offsetInBytes + |
| 2817 (index * Int64List.BYTES_PER_ELEMENT)); | 2818 (index * Int64List.BYTES_PER_ELEMENT)); |
| 2818 } | 2819 } |
| 2819 | 2820 |
| 2820 void operator[]=(int index, int value) { | 2821 void operator[]=(int index, int value) { |
| 2821 if (index < 0 || index >= length) { | 2822 if (index < 0 || index >= length) { |
| 2822 _throwRangeError(index, length); | 2823 throw _newRangeError(index, length); |
| 2823 } | 2824 } |
| 2824 _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT), | 2825 _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT), |
| 2825 _toInt64(value)); | 2826 _toInt64(value)); |
| 2826 } | 2827 } |
| 2827 | 2828 |
| 2828 | 2829 |
| 2829 // Method(s) implementing TypedData interface. | 2830 // Method(s) implementing TypedData interface. |
| 2830 | 2831 |
| 2831 int get elementSizeInBytes { | 2832 int get elementSizeInBytes { |
| 2832 return Int64List.BYTES_PER_ELEMENT; | 2833 return Int64List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2852 offsetInBytes, | 2853 offsetInBytes, |
| 2853 length * Uint64List.BYTES_PER_ELEMENT); | 2854 length * Uint64List.BYTES_PER_ELEMENT); |
| 2854 _offsetAlignmentCheck(_offsetInBytes, Uint64List.BYTES_PER_ELEMENT); | 2855 _offsetAlignmentCheck(_offsetInBytes, Uint64List.BYTES_PER_ELEMENT); |
| 2855 } | 2856 } |
| 2856 | 2857 |
| 2857 | 2858 |
| 2858 // Method(s) implementing List interface. | 2859 // Method(s) implementing List interface. |
| 2859 | 2860 |
| 2860 int operator[](int index) { | 2861 int operator[](int index) { |
| 2861 if (index < 0 || index >= length) { | 2862 if (index < 0 || index >= length) { |
| 2862 _throwRangeError(index, length); | 2863 throw _newRangeError(index, length); |
| 2863 } | 2864 } |
| 2864 return _typedData._getUint64(offsetInBytes + | 2865 return _typedData._getUint64(offsetInBytes + |
| 2865 (index * Uint64List.BYTES_PER_ELEMENT)); | 2866 (index * Uint64List.BYTES_PER_ELEMENT)); |
| 2866 } | 2867 } |
| 2867 | 2868 |
| 2868 void operator[]=(int index, int value) { | 2869 void operator[]=(int index, int value) { |
| 2869 if (index < 0 || index >= length) { | 2870 if (index < 0 || index >= length) { |
| 2870 _throwRangeError(index, length); | 2871 throw _newRangeError(index, length); |
| 2871 } | 2872 } |
| 2872 _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT)
, | 2873 _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT)
, |
| 2873 _toUint64(value)); | 2874 _toUint64(value)); |
| 2874 } | 2875 } |
| 2875 | 2876 |
| 2876 | 2877 |
| 2877 // Method(s) implementing TypedData interface. | 2878 // Method(s) implementing TypedData interface. |
| 2878 | 2879 |
| 2879 int get elementSizeInBytes { | 2880 int get elementSizeInBytes { |
| 2880 return Uint64List.BYTES_PER_ELEMENT; | 2881 return Uint64List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2900 offsetInBytes, | 2901 offsetInBytes, |
| 2901 length * Float32List.BYTES_PER_ELEMENT); | 2902 length * Float32List.BYTES_PER_ELEMENT); |
| 2902 _offsetAlignmentCheck(_offsetInBytes, Float32List.BYTES_PER_ELEMENT); | 2903 _offsetAlignmentCheck(_offsetInBytes, Float32List.BYTES_PER_ELEMENT); |
| 2903 } | 2904 } |
| 2904 | 2905 |
| 2905 | 2906 |
| 2906 // Method(s) implementing List interface. | 2907 // Method(s) implementing List interface. |
| 2907 | 2908 |
| 2908 double operator[](int index) { | 2909 double operator[](int index) { |
| 2909 if (index < 0 || index >= length) { | 2910 if (index < 0 || index >= length) { |
| 2910 _throwRangeError(index, length); | 2911 throw _newRangeError(index, length); |
| 2911 } | 2912 } |
| 2912 return _typedData._getFloat32(offsetInBytes + | 2913 return _typedData._getFloat32(offsetInBytes + |
| 2913 (index * Float32List.BYTES_PER_ELEMENT)); | 2914 (index * Float32List.BYTES_PER_ELEMENT)); |
| 2914 } | 2915 } |
| 2915 | 2916 |
| 2916 void operator[]=(int index, double value) { | 2917 void operator[]=(int index, double value) { |
| 2917 if (index < 0 || index >= length) { | 2918 if (index < 0 || index >= length) { |
| 2918 _throwRangeError(index, length); | 2919 throw _newRangeError(index, length); |
| 2919 } | 2920 } |
| 2920 _typedData._setFloat32(offsetInBytes + | 2921 _typedData._setFloat32(offsetInBytes + |
| 2921 (index * Float32List.BYTES_PER_ELEMENT), value); | 2922 (index * Float32List.BYTES_PER_ELEMENT), value); |
| 2922 } | 2923 } |
| 2923 | 2924 |
| 2924 | 2925 |
| 2925 // Method(s) implementing TypedData interface. | 2926 // Method(s) implementing TypedData interface. |
| 2926 | 2927 |
| 2927 int get elementSizeInBytes { | 2928 int get elementSizeInBytes { |
| 2928 return Float32List.BYTES_PER_ELEMENT; | 2929 return Float32List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2948 offsetInBytes, | 2949 offsetInBytes, |
| 2949 length * Float64List.BYTES_PER_ELEMENT); | 2950 length * Float64List.BYTES_PER_ELEMENT); |
| 2950 _offsetAlignmentCheck(_offsetInBytes, Float64List.BYTES_PER_ELEMENT); | 2951 _offsetAlignmentCheck(_offsetInBytes, Float64List.BYTES_PER_ELEMENT); |
| 2951 } | 2952 } |
| 2952 | 2953 |
| 2953 | 2954 |
| 2954 // Method(s) implementing List interface. | 2955 // Method(s) implementing List interface. |
| 2955 | 2956 |
| 2956 double operator[](int index) { | 2957 double operator[](int index) { |
| 2957 if (index < 0 || index >= length) { | 2958 if (index < 0 || index >= length) { |
| 2958 _throwRangeError(index, length); | 2959 throw _newRangeError(index, length); |
| 2959 } | 2960 } |
| 2960 return _typedData._getFloat64(offsetInBytes + | 2961 return _typedData._getFloat64(offsetInBytes + |
| 2961 (index * Float64List.BYTES_PER_ELEMENT)); | 2962 (index * Float64List.BYTES_PER_ELEMENT)); |
| 2962 } | 2963 } |
| 2963 | 2964 |
| 2964 void operator[]=(int index, double value) { | 2965 void operator[]=(int index, double value) { |
| 2965 if (index < 0 || index >= length) { | 2966 if (index < 0 || index >= length) { |
| 2966 _throwRangeError(index, length); | 2967 throw _newRangeError(index, length); |
| 2967 } | 2968 } |
| 2968 _typedData._setFloat64(offsetInBytes + | 2969 _typedData._setFloat64(offsetInBytes + |
| 2969 (index * Float64List.BYTES_PER_ELEMENT), value); | 2970 (index * Float64List.BYTES_PER_ELEMENT), value); |
| 2970 } | 2971 } |
| 2971 | 2972 |
| 2972 | 2973 |
| 2973 // Method(s) implementing TypedData interface. | 2974 // Method(s) implementing TypedData interface. |
| 2974 | 2975 |
| 2975 int get elementSizeInBytes { | 2976 int get elementSizeInBytes { |
| 2976 return Float64List.BYTES_PER_ELEMENT; | 2977 return Float64List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2996 offsetInBytes, | 2997 offsetInBytes, |
| 2997 length * Float32x4List.BYTES_PER_ELEMENT); | 2998 length * Float32x4List.BYTES_PER_ELEMENT); |
| 2998 _offsetAlignmentCheck(_offsetInBytes, Float32x4List.BYTES_PER_ELEMENT); | 2999 _offsetAlignmentCheck(_offsetInBytes, Float32x4List.BYTES_PER_ELEMENT); |
| 2999 } | 3000 } |
| 3000 | 3001 |
| 3001 | 3002 |
| 3002 // Method(s) implementing List interface. | 3003 // Method(s) implementing List interface. |
| 3003 | 3004 |
| 3004 Float32x4 operator[](int index) { | 3005 Float32x4 operator[](int index) { |
| 3005 if (index < 0 || index >= length) { | 3006 if (index < 0 || index >= length) { |
| 3006 _throwRangeError(index, length); | 3007 throw _newRangeError(index, length); |
| 3007 } | 3008 } |
| 3008 return _typedData._getFloat32x4(offsetInBytes + | 3009 return _typedData._getFloat32x4(offsetInBytes + |
| 3009 (index * Float32x4List.BYTES_PER_ELEMENT)); | 3010 (index * Float32x4List.BYTES_PER_ELEMENT)); |
| 3010 } | 3011 } |
| 3011 | 3012 |
| 3012 void operator[]=(int index, Float32x4 value) { | 3013 void operator[]=(int index, Float32x4 value) { |
| 3013 if (index < 0 || index >= length) { | 3014 if (index < 0 || index >= length) { |
| 3014 _throwRangeError(index, length); | 3015 throw _newRangeError(index, length); |
| 3015 } | 3016 } |
| 3016 _typedData._setFloat32x4(offsetInBytes + | 3017 _typedData._setFloat32x4(offsetInBytes + |
| 3017 (index * Float32x4List.BYTES_PER_ELEMENT), value); | 3018 (index * Float32x4List.BYTES_PER_ELEMENT), value); |
| 3018 } | 3019 } |
| 3019 | 3020 |
| 3020 | 3021 |
| 3021 // Method(s) implementing TypedData interface. | 3022 // Method(s) implementing TypedData interface. |
| 3022 | 3023 |
| 3023 int get elementSizeInBytes { | 3024 int get elementSizeInBytes { |
| 3024 return Float32x4List.BYTES_PER_ELEMENT; | 3025 return Float32x4List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3044 offsetInBytes, | 3045 offsetInBytes, |
| 3045 length * Int32x4List.BYTES_PER_ELEMENT); | 3046 length * Int32x4List.BYTES_PER_ELEMENT); |
| 3046 _offsetAlignmentCheck(_offsetInBytes, Int32x4List.BYTES_PER_ELEMENT); | 3047 _offsetAlignmentCheck(_offsetInBytes, Int32x4List.BYTES_PER_ELEMENT); |
| 3047 } | 3048 } |
| 3048 | 3049 |
| 3049 | 3050 |
| 3050 // Method(s) implementing List interface. | 3051 // Method(s) implementing List interface. |
| 3051 | 3052 |
| 3052 Int32x4 operator[](int index) { | 3053 Int32x4 operator[](int index) { |
| 3053 if (index < 0 || index >= length) { | 3054 if (index < 0 || index >= length) { |
| 3054 _throwRangeError(index, length); | 3055 throw _newRangeError(index, length); |
| 3055 } | 3056 } |
| 3056 return _typedData._getInt32x4(offsetInBytes + | 3057 return _typedData._getInt32x4(offsetInBytes + |
| 3057 (index * Int32x4List.BYTES_PER_ELEMENT)); | 3058 (index * Int32x4List.BYTES_PER_ELEMENT)); |
| 3058 } | 3059 } |
| 3059 | 3060 |
| 3060 void operator[]=(int index, Int32x4 value) { | 3061 void operator[]=(int index, Int32x4 value) { |
| 3061 if (index < 0 || index >= length) { | 3062 if (index < 0 || index >= length) { |
| 3062 _throwRangeError(index, length); | 3063 throw _newRangeError(index, length); |
| 3063 } | 3064 } |
| 3064 _typedData._setInt32x4(offsetInBytes + | 3065 _typedData._setInt32x4(offsetInBytes + |
| 3065 (index * Int32x4List.BYTES_PER_ELEMENT), value); | 3066 (index * Int32x4List.BYTES_PER_ELEMENT), value); |
| 3066 } | 3067 } |
| 3067 | 3068 |
| 3068 | 3069 |
| 3069 // Method(s) implementing TypedData interface. | 3070 // Method(s) implementing TypedData interface. |
| 3070 | 3071 |
| 3071 int get elementSizeInBytes { | 3072 int get elementSizeInBytes { |
| 3072 return Int32x4List.BYTES_PER_ELEMENT; | 3073 return Int32x4List.BYTES_PER_ELEMENT; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3092 offsetInBytes, | 3093 offsetInBytes, |
| 3093 length * Float64x2List.BYTES_PER_ELEMENT); | 3094 length * Float64x2List.BYTES_PER_ELEMENT); |
| 3094 _offsetAlignmentCheck(_offsetInBytes, Float64x2List.BYTES_PER_ELEMENT); | 3095 _offsetAlignmentCheck(_offsetInBytes, Float64x2List.BYTES_PER_ELEMENT); |
| 3095 } | 3096 } |
| 3096 | 3097 |
| 3097 | 3098 |
| 3098 // Method(s) implementing List interface. | 3099 // Method(s) implementing List interface. |
| 3099 | 3100 |
| 3100 Float64x2 operator[](int index) { | 3101 Float64x2 operator[](int index) { |
| 3101 if (index < 0 || index >= length) { | 3102 if (index < 0 || index >= length) { |
| 3102 _throwRangeError(index, length); | 3103 throw _newRangeError(index, length); |
| 3103 } | 3104 } |
| 3104 return _typedData._getFloat64x2(offsetInBytes + | 3105 return _typedData._getFloat64x2(offsetInBytes + |
| 3105 (index * Float64x2List.BYTES_PER_ELEMENT)); | 3106 (index * Float64x2List.BYTES_PER_ELEMENT)); |
| 3106 } | 3107 } |
| 3107 | 3108 |
| 3108 void operator[]=(int index, Float64x2 value) { | 3109 void operator[]=(int index, Float64x2 value) { |
| 3109 if (index < 0 || index >= length) { | 3110 if (index < 0 || index >= length) { |
| 3110 _throwRangeError(index, length); | 3111 throw _newRangeError(index, length); |
| 3111 } | 3112 } |
| 3112 _typedData._setFloat64x2(offsetInBytes + | 3113 _typedData._setFloat64x2(offsetInBytes + |
| 3113 (index * Float64x2List.BYTES_PER_ELEMENT), value); | 3114 (index * Float64x2List.BYTES_PER_ELEMENT), value); |
| 3114 } | 3115 } |
| 3115 | 3116 |
| 3116 | 3117 |
| 3117 // Method(s) implementing TypedData interface. | 3118 // Method(s) implementing TypedData interface. |
| 3118 | 3119 |
| 3119 int get elementSizeInBytes { | 3120 int get elementSizeInBytes { |
| 3120 return Float64x2List.BYTES_PER_ELEMENT; | 3121 return Float64x2List.BYTES_PER_ELEMENT; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3153 } | 3154 } |
| 3154 | 3155 |
| 3155 int get elementSizeInBytes { | 3156 int get elementSizeInBytes { |
| 3156 return 1; | 3157 return 1; |
| 3157 } | 3158 } |
| 3158 | 3159 |
| 3159 // Method(s) implementing ByteData interface. | 3160 // Method(s) implementing ByteData interface. |
| 3160 | 3161 |
| 3161 int getInt8(int byteOffset) { | 3162 int getInt8(int byteOffset) { |
| 3162 if (byteOffset < 0 || byteOffset >= length) { | 3163 if (byteOffset < 0 || byteOffset >= length) { |
| 3163 _throwRangeError(byteOffset, length); | 3164 throw _newRangeError(byteOffset, length); |
| 3164 } | 3165 } |
| 3165 return _typedData._getInt8(_offset + byteOffset); | 3166 return _typedData._getInt8(_offset + byteOffset); |
| 3166 } | 3167 } |
| 3167 void setInt8(int byteOffset, int value) { | 3168 void setInt8(int byteOffset, int value) { |
| 3168 if (byteOffset < 0 || byteOffset >= length) { | 3169 if (byteOffset < 0 || byteOffset >= length) { |
| 3169 _throwRangeError(byteOffset, length); | 3170 throw _newRangeError(byteOffset, length); |
| 3170 } | 3171 } |
| 3171 _typedData._setInt8(_offset + byteOffset, _toInt8(value)); | 3172 _typedData._setInt8(_offset + byteOffset, _toInt8(value)); |
| 3172 } | 3173 } |
| 3173 | 3174 |
| 3174 int getUint8(int byteOffset) { | 3175 int getUint8(int byteOffset) { |
| 3175 if (byteOffset < 0 || byteOffset >= length) { | 3176 if (byteOffset < 0 || byteOffset >= length) { |
| 3176 _throwRangeError(byteOffset, length); | 3177 throw _newRangeError(byteOffset, length); |
| 3177 } | 3178 } |
| 3178 return _typedData._getUint8(_offset + byteOffset); | 3179 return _typedData._getUint8(_offset + byteOffset); |
| 3179 } | 3180 } |
| 3180 void setUint8(int byteOffset, int value) { | 3181 void setUint8(int byteOffset, int value) { |
| 3181 if (byteOffset < 0 || byteOffset >= length) { | 3182 if (byteOffset < 0 || byteOffset >= length) { |
| 3182 _throwRangeError(byteOffset, length); | 3183 throw _newRangeError(byteOffset, length); |
| 3183 } | 3184 } |
| 3184 _typedData._setUint8(_offset + byteOffset, _toUint8(value)); | 3185 _typedData._setUint8(_offset + byteOffset, _toUint8(value)); |
| 3185 } | 3186 } |
| 3186 | 3187 |
| 3187 int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3188 int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3188 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3189 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3189 _throwRangeError(byteOffset + 1, length); | 3190 throw _newRangeError(byteOffset + 1, length); |
| 3190 } | 3191 } |
| 3191 var result = _typedData._getInt16(_offset + byteOffset); | 3192 var result = _typedData._getInt16(_offset + byteOffset); |
| 3192 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3193 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3193 return result; | 3194 return result; |
| 3194 } | 3195 } |
| 3195 return _toEndianInt16(result, endian._littleEndian); | 3196 return _toEndianInt16(result, endian._littleEndian); |
| 3196 } | 3197 } |
| 3197 void setInt16(int byteOffset, | 3198 void setInt16(int byteOffset, |
| 3198 int value, | 3199 int value, |
| 3199 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3200 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3200 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3201 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3201 _throwRangeError(byteOffset + 1, length); | 3202 throw _newRangeError(byteOffset + 1, length); |
| 3202 } | 3203 } |
| 3203 var set_value = _toInt16(value); | 3204 var set_value = _toInt16(value); |
| 3204 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3205 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3205 set_value = _toEndianInt16(set_value, endian._littleEndian); | 3206 set_value = _toEndianInt16(set_value, endian._littleEndian); |
| 3206 } | 3207 } |
| 3207 _typedData._setInt16(_offset + byteOffset, set_value); | 3208 _typedData._setInt16(_offset + byteOffset, set_value); |
| 3208 } | 3209 } |
| 3209 | 3210 |
| 3210 int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3211 int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3211 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3212 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3212 _throwRangeError(byteOffset + 1, length); | 3213 throw _newRangeError(byteOffset + 1, length); |
| 3213 } | 3214 } |
| 3214 var result = _typedData._getUint16(_offset + byteOffset); | 3215 var result = _typedData._getUint16(_offset + byteOffset); |
| 3215 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3216 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3216 return result; | 3217 return result; |
| 3217 } | 3218 } |
| 3218 return _toEndianUint16(result, endian._littleEndian); | 3219 return _toEndianUint16(result, endian._littleEndian); |
| 3219 } | 3220 } |
| 3220 void setUint16(int byteOffset, | 3221 void setUint16(int byteOffset, |
| 3221 int value, | 3222 int value, |
| 3222 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3223 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3223 if (byteOffset < 0 || byteOffset + 1 >= length) { | 3224 if (byteOffset < 0 || byteOffset + 1 >= length) { |
| 3224 _throwRangeError(byteOffset + 1, length); | 3225 throw _newRangeError(byteOffset + 1, length); |
| 3225 } | 3226 } |
| 3226 var set_value = _toUint16(value); | 3227 var set_value = _toUint16(value); |
| 3227 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3228 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3228 set_value = _toEndianUint16(set_value, endian._littleEndian); | 3229 set_value = _toEndianUint16(set_value, endian._littleEndian); |
| 3229 } | 3230 } |
| 3230 _typedData._setUint16(_offset + byteOffset, set_value); | 3231 _typedData._setUint16(_offset + byteOffset, set_value); |
| 3231 } | 3232 } |
| 3232 | 3233 |
| 3233 int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3234 int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3234 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3235 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3235 _throwRangeError(byteOffset + 3, length); | 3236 throw _newRangeError(byteOffset + 3, length); |
| 3236 } | 3237 } |
| 3237 var result = _typedData._getInt32(_offset + byteOffset); | 3238 var result = _typedData._getInt32(_offset + byteOffset); |
| 3238 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3239 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3239 return result; | 3240 return result; |
| 3240 } | 3241 } |
| 3241 return _toEndianInt32(result, endian._littleEndian); | 3242 return _toEndianInt32(result, endian._littleEndian); |
| 3242 } | 3243 } |
| 3243 void setInt32(int byteOffset, | 3244 void setInt32(int byteOffset, |
| 3244 int value, | 3245 int value, |
| 3245 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3246 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3246 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3247 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3247 _throwRangeError(byteOffset + 3, length); | 3248 throw _newRangeError(byteOffset + 3, length); |
| 3248 } | 3249 } |
| 3249 var set_value = _toInt32(value); | 3250 var set_value = _toInt32(value); |
| 3250 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3251 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3251 set_value = _toEndianInt32(set_value, endian._littleEndian); | 3252 set_value = _toEndianInt32(set_value, endian._littleEndian); |
| 3252 } | 3253 } |
| 3253 _typedData._setInt32(_offset + byteOffset, set_value); | 3254 _typedData._setInt32(_offset + byteOffset, set_value); |
| 3254 } | 3255 } |
| 3255 | 3256 |
| 3256 int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3257 int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3257 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3258 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3258 _throwRangeError(byteOffset + 3, length); | 3259 throw _newRangeError(byteOffset + 3, length); |
| 3259 } | 3260 } |
| 3260 var result = _typedData._getUint32(_offset + byteOffset); | 3261 var result = _typedData._getUint32(_offset + byteOffset); |
| 3261 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3262 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3262 return result; | 3263 return result; |
| 3263 } | 3264 } |
| 3264 return _toEndianUint32(result, endian._littleEndian); | 3265 return _toEndianUint32(result, endian._littleEndian); |
| 3265 } | 3266 } |
| 3266 void setUint32(int byteOffset, | 3267 void setUint32(int byteOffset, |
| 3267 int value, | 3268 int value, |
| 3268 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3269 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3269 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3270 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3270 _throwRangeError(byteOffset + 3, length); | 3271 throw _newRangeError(byteOffset + 3, length); |
| 3271 } | 3272 } |
| 3272 var set_value = _toUint32(value); | 3273 var set_value = _toUint32(value); |
| 3273 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3274 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3274 set_value = _toEndianUint32(set_value, endian._littleEndian); | 3275 set_value = _toEndianUint32(set_value, endian._littleEndian); |
| 3275 } | 3276 } |
| 3276 _typedData._setUint32(_offset + byteOffset, set_value); | 3277 _typedData._setUint32(_offset + byteOffset, set_value); |
| 3277 } | 3278 } |
| 3278 | 3279 |
| 3279 int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3280 int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3280 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3281 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3281 _throwRangeError(byteOffset + 7, length); | 3282 throw _newRangeError(byteOffset + 7, length); |
| 3282 } | 3283 } |
| 3283 var result = _typedData._getInt64(_offset + byteOffset); | 3284 var result = _typedData._getInt64(_offset + byteOffset); |
| 3284 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3285 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3285 return result; | 3286 return result; |
| 3286 } | 3287 } |
| 3287 return _toEndianInt64(result, endian._littleEndian); | 3288 return _toEndianInt64(result, endian._littleEndian); |
| 3288 } | 3289 } |
| 3289 void setInt64(int byteOffset, | 3290 void setInt64(int byteOffset, |
| 3290 int value, | 3291 int value, |
| 3291 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3292 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3292 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3293 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3293 _throwRangeError(byteOffset + 7, length); | 3294 throw _newRangeError(byteOffset + 7, length); |
| 3294 } | 3295 } |
| 3295 var set_value = _toInt64(value); | 3296 var set_value = _toInt64(value); |
| 3296 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3297 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3297 set_value = _toEndianInt64(set_value, endian._littleEndian); | 3298 set_value = _toEndianInt64(set_value, endian._littleEndian); |
| 3298 } | 3299 } |
| 3299 _typedData._setInt64(_offset + byteOffset, set_value); | 3300 _typedData._setInt64(_offset + byteOffset, set_value); |
| 3300 } | 3301 } |
| 3301 | 3302 |
| 3302 int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { | 3303 int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3303 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3304 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3304 _throwRangeError(byteOffset + 7, length); | 3305 throw _newRangeError(byteOffset + 7, length); |
| 3305 } | 3306 } |
| 3306 var result = _typedData._getUint64(_offset + byteOffset); | 3307 var result = _typedData._getUint64(_offset + byteOffset); |
| 3307 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3308 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3308 return result; | 3309 return result; |
| 3309 } | 3310 } |
| 3310 return _toEndianUint64(result, endian._littleEndian); | 3311 return _toEndianUint64(result, endian._littleEndian); |
| 3311 } | 3312 } |
| 3312 void setUint64(int byteOffset, | 3313 void setUint64(int byteOffset, |
| 3313 int value, | 3314 int value, |
| 3314 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3315 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3315 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3316 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3316 _throwRangeError(byteOffset + 7, length); | 3317 throw _newRangeError(byteOffset + 7, length); |
| 3317 } | 3318 } |
| 3318 var set_value = _toUint64(value); | 3319 var set_value = _toUint64(value); |
| 3319 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3320 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3320 set_value = _toEndianUint64(set_value, endian._littleEndian); | 3321 set_value = _toEndianUint64(set_value, endian._littleEndian); |
| 3321 } | 3322 } |
| 3322 _typedData._setUint64(_offset + byteOffset, set_value); | 3323 _typedData._setUint64(_offset + byteOffset, set_value); |
| 3323 } | 3324 } |
| 3324 | 3325 |
| 3325 double getFloat32(int byteOffset, | 3326 double getFloat32(int byteOffset, |
| 3326 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3327 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3327 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3328 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3328 _throwRangeError(byteOffset + 3, length); | 3329 throw _newRangeError(byteOffset + 3, length); |
| 3329 } | 3330 } |
| 3330 var result = _typedData._getFloat32(_offset + byteOffset); | 3331 var result = _typedData._getFloat32(_offset + byteOffset); |
| 3331 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3332 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3332 return result; | 3333 return result; |
| 3333 } | 3334 } |
| 3334 return _toEndianFloat32(result, endian._littleEndian); | 3335 return _toEndianFloat32(result, endian._littleEndian); |
| 3335 } | 3336 } |
| 3336 void setFloat32(int byteOffset, | 3337 void setFloat32(int byteOffset, |
| 3337 double value, | 3338 double value, |
| 3338 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3339 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3339 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3340 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3340 _throwRangeError(byteOffset + 3, length); | 3341 throw _newRangeError(byteOffset + 3, length); |
| 3341 } | 3342 } |
| 3342 var set_value = value; | 3343 var set_value = value; |
| 3343 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3344 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3344 set_value = _toEndianFloat32(set_value, endian._littleEndian); | 3345 set_value = _toEndianFloat32(set_value, endian._littleEndian); |
| 3345 } | 3346 } |
| 3346 _typedData._setFloat32(_offset + byteOffset, set_value); | 3347 _typedData._setFloat32(_offset + byteOffset, set_value); |
| 3347 } | 3348 } |
| 3348 | 3349 |
| 3349 double getFloat64(int byteOffset, | 3350 double getFloat64(int byteOffset, |
| 3350 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3351 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3351 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3352 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3352 _throwRangeError(byteOffset + 7, length); | 3353 throw _newRangeError(byteOffset + 7, length); |
| 3353 } | 3354 } |
| 3354 var result = _typedData._getFloat64(_offset + byteOffset); | 3355 var result = _typedData._getFloat64(_offset + byteOffset); |
| 3355 if (identical(endian, Endianness.HOST_ENDIAN)) { | 3356 if (identical(endian, Endianness.HOST_ENDIAN)) { |
| 3356 return result; | 3357 return result; |
| 3357 } | 3358 } |
| 3358 return _toEndianFloat64(result, endian._littleEndian); | 3359 return _toEndianFloat64(result, endian._littleEndian); |
| 3359 } | 3360 } |
| 3360 void setFloat64(int byteOffset, | 3361 void setFloat64(int byteOffset, |
| 3361 double value, | 3362 double value, |
| 3362 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3363 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3363 if (byteOffset < 0 || byteOffset + 7 >= length) { | 3364 if (byteOffset < 0 || byteOffset + 7 >= length) { |
| 3364 _throwRangeError(byteOffset + 7, length); | 3365 throw _newRangeError(byteOffset + 7, length); |
| 3365 } | 3366 } |
| 3366 var set_value = value; | 3367 var set_value = value; |
| 3367 if (!identical(endian, Endianness.HOST_ENDIAN)) { | 3368 if (!identical(endian, Endianness.HOST_ENDIAN)) { |
| 3368 set_value = _toEndianFloat64(set_value, endian._littleEndian); | 3369 set_value = _toEndianFloat64(set_value, endian._littleEndian); |
| 3369 } | 3370 } |
| 3370 _typedData._setFloat64(_offset + byteOffset, set_value); | 3371 _typedData._setFloat64(_offset + byteOffset, set_value); |
| 3371 } | 3372 } |
| 3372 | 3373 |
| 3373 Float32x4 getFloat32x4(int byteOffset, | 3374 Float32x4 getFloat32x4(int byteOffset, |
| 3374 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3375 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3375 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3376 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3376 _throwRangeError(byteOffset + 3, length); | 3377 throw _newRangeError(byteOffset + 3, length); |
| 3377 } | 3378 } |
| 3378 // TODO(johnmccutchan) : Need to resolve this for endianity. | 3379 // TODO(johnmccutchan) : Need to resolve this for endianity. |
| 3379 return _typedData._getFloat32x4(_offset + byteOffset); | 3380 return _typedData._getFloat32x4(_offset + byteOffset); |
| 3380 } | 3381 } |
| 3381 void setFloat32x4(int byteOffset, | 3382 void setFloat32x4(int byteOffset, |
| 3382 Float32x4 value, | 3383 Float32x4 value, |
| 3383 [Endianness endian = Endianness.BIG_ENDIAN]) { | 3384 [Endianness endian = Endianness.BIG_ENDIAN]) { |
| 3384 if (byteOffset < 0 || byteOffset + 3 >= length) { | 3385 if (byteOffset < 0 || byteOffset + 3 >= length) { |
| 3385 _throwRangeError(byteOffset + 3, length); | 3386 throw _newRangeError(byteOffset + 3, length); |
| 3386 } | 3387 } |
| 3387 // TODO(johnmccutchan) : Need to resolve this for endianity. | 3388 // TODO(johnmccutchan) : Need to resolve this for endianity. |
| 3388 _typedData._setFloat32x4(_offset + byteOffset, value); | 3389 _typedData._setFloat32x4(_offset + byteOffset, value); |
| 3389 | 3390 |
| 3390 } | 3391 } |
| 3391 | 3392 |
| 3392 | 3393 |
| 3393 // Internal utility methods. | 3394 // Internal utility methods. |
| 3394 | 3395 |
| 3395 static int _toEndianInt16(int host_value, bool little_endian) | 3396 static int _toEndianInt16(int host_value, bool little_endian) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3493 | 3494 |
| 3494 | 3495 |
| 3495 int _defaultIfNull(object, value) { | 3496 int _defaultIfNull(object, value) { |
| 3496 if (object == null) { | 3497 if (object == null) { |
| 3497 return value; | 3498 return value; |
| 3498 } | 3499 } |
| 3499 return object; | 3500 return object; |
| 3500 } | 3501 } |
| 3501 | 3502 |
| 3502 | 3503 |
| 3503 void _throwRangeError(int index, int length) { | 3504 void _newRangeError(int index, int length) { |
| 3504 String message = "$index must be in the range [0..$length)"; | 3505 String message = "$index must be in the range [0..$length)"; |
| 3505 throw new RangeError(message); | 3506 return new RangeError(message); |
| 3506 } | 3507 } |
| OLD | NEW |