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

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

Issue 763443005: Fix implementation of the Iterable interface for typed data lists. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 268 }
269 269
270 Iterable map(f(element)) { 270 Iterable map(f(element)) {
271 return IterableMixinWorkaround.mapList(this, f); 271 return IterableMixinWorkaround.mapList(this, f);
272 } 272 }
273 273
274 Iterable expand(Iterable f(element)) { 274 Iterable expand(Iterable f(element)) {
275 return IterableMixinWorkaround.expand(this, f); 275 return IterableMixinWorkaround.expand(this, f);
276 } 276 }
277 277
278 // The following methods need to know the element type (int or double).
279 Iterable where(bool f(element)) {
280 return new IterableMixinWorkaround().where(this, f);
281 }
282
283 Iterable take(int n) {
284 return new IterableMixinWorkaround().takeList(this, n);
285 }
286
287 Iterable takeWhile(bool test(element)) {
288 return new IterableMixinWorkaround().takeWhile(this, test);
289 }
290
291 Iterable skip(int n) {
292 return new IterableMixinWorkaround().skipList(this, n);
293 }
294
295 Iterable skipWhile(bool test(element)) {
296 return new IterableMixinWorkaround().skipWhile(this, test);
297 }
298
299 Iterable<dynamic> get reversed {
300 return new IterableMixinWorkaround().reversedList(this);
301 }
302
303 Map<int, dynamic> asMap() {
304 return new IterableMixinWorkaround().asMapList(this);
305 }
306
307 Iterable getRange(int start, [int end]) {
308 return new IterableMixinWorkaround().getRangeList(this, start, end);
309 }
310 // End of methods returning incorrectly parameterized types.
311
312 bool every(bool f(element)) { 278 bool every(bool f(element)) {
313 return IterableMixinWorkaround.every(this, f); 279 return IterableMixinWorkaround.every(this, f);
314 } 280 }
315 281
316 bool any(bool f(element)) { 282 bool any(bool f(element)) {
317 return IterableMixinWorkaround.any(this, f); 283 return IterableMixinWorkaround.any(this, f);
318 } 284 }
319 285
320 dynamic firstWhere(bool test(element), {orElse()}) { 286 dynamic firstWhere(bool test(element), {orElse()}) {
321 return IterableMixinWorkaround.firstWhere(this, test, orElse); 287 return IterableMixinWorkaround.firstWhere(this, test, orElse);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 // match the cids of 'this' and 'from'. 494 // match the cids of 'this' and 'from'.
529 // Uses toCid and fromCid to decide if clamping is necessary. 495 // Uses toCid and fromCid to decide if clamping is necessary.
530 // Element size of toCid and fromCid must match (test at caller). 496 // Element size of toCid and fromCid must match (test at caller).
531 bool _setRange(int startInBytes, int lengthInBytes, 497 bool _setRange(int startInBytes, int lengthInBytes,
532 _TypedListBase from, int startFromInBytes, 498 _TypedListBase from, int startFromInBytes,
533 int toCid, int fromCid) 499 int toCid, int fromCid)
534 native "TypedData_setRange"; 500 native "TypedData_setRange";
535 } 501 }
536 502
537 503
504 class _IntListMixin {
505 Iterable<int> where(bool f(int element)) => new WhereIterable<int>(this, f);
506
507 Iterable<int> take(int n) => new SubListIterable<int>(this, 0, n);
508
509 Iterable<int> takeWhile(bool test(int element)) =>
510 new TakeWhileIterable<int>(this, test);
511
512 Iterable<int> skip(int n) => new SubListIterable<int>(this, n, null);
513
514 Iterable<int> skipWhile(bool test(element)) =>
515 new SkipWhileIterable<int>(this, test);
516
517 Iterable<int> get reversed => new ReversedListIterable<int>(this);
518
519 Map<int, int> asMap() => new ListMapView<int>(this);
520
521 Iterable<int> getRange(int start, [int end]) {
522 RangeError.checkValidRange(start, end, this.length);
523 return new SubListIterable<int>(this, start, end);
524 }
525
526 Iterator<int> get iterator => new _TypedListIterator<int>(this);
527 }
528
529
530 class _DoubleListMixin {
531 Iterable<double> where(bool f(int element)) =>
532 new WhereIterable<double>(this, f);
533
534 Iterable<double> take(int n) => new SubListIterable<double>(this, 0, n);
535
536 Iterable<double> takeWhile(bool test(int element)) =>
537 new TakeWhileIterable<double>(this, test);
538
539 Iterable<double> skip(int n) => new SubListIterable<double>(this, n, null);
540
541 Iterable<double> skipWhile(bool test(element)) =>
542 new SkipWhileIterable<double>(this, test);
543
544 Iterable<double> get reversed => new ReversedListIterable<double>(this);
545
546 Map<int, double> asMap() => new ListMapView<double>(this);
547
548 Iterable<double> getRange(int start, [int end]) {
549 RangeError.checkValidRange(start, end, this.length);
550 return new SubListIterable<double>(this, start, end);
551 }
552
553 Iterator<double> get iterator => new _TypedListIterator<double>(this);
554 }
555
556
557 class _Float32x4ListMixin {
558 Iterable<Float32x4> where(bool f(int element)) =>
559 new WhereIterable<Float32x4>(this, f);
560
561 Iterable<Float32x4> take(int n) => new SubListIterable<Float32x4>(this, 0, n);
562
563 Iterable<Float32x4> takeWhile(bool test(int element)) =>
564 new TakeWhileIterable<Float32x4>(this, test);
565
566 Iterable<Float32x4> skip(int n) =>
567 new SubListIterable<Float32x4>(this, n, null);
568
569 Iterable<Float32x4> skipWhile(bool test(element)) =>
570 new SkipWhileIterable<Float32x4>(this, test);
571
572 Iterable<Float32x4> get reversed => new ReversedListIterable<Float32x4>(this);
573
574 Map<int, Float32x4> asMap() => new ListMapView<Float32x4>(this);
575
576 Iterable<Float32x4> getRange(int start, [int end]) {
577 RangeError.checkValidRange(start, end, this.length);
578 return new SubListIterable<Float32x4>(this, start, end);
579 }
580
581 Iterator<Float32x4> get iterator => new _TypedListIterator<Float32x4>(this);
582 }
583
584
585 class _Int32x4ListMixin {
586 Iterable<Int32x4> where(bool f(int element)) =>
587 new WhereIterable<Int32x4>(this, f);
588
589 Iterable<Int32x4> take(int n) => new SubListIterable<Int32x4>(this, 0, n);
590
591 Iterable<Int32x4> takeWhile(bool test(int element)) =>
592 new TakeWhileIterable<Int32x4>(this, test);
593
594 Iterable<Int32x4> skip(int n) => new SubListIterable<Int32x4>(this, n, null);
595
596 Iterable<Int32x4> skipWhile(bool test(element)) =>
597 new SkipWhileIterable<Int32x4>(this, test);
598
599 Iterable<Int32x4> get reversed => new ReversedListIterable<Int32x4>(this);
600
601 Map<int, Int32x4> asMap() => new ListMapView<Int32x4>(this);
602
603 Iterable<Int32x4> getRange(int start, [int end]) {
604 RangeError.checkValidRange(start, end, this.length);
605 return new SubListIterable<Int32x4>(this, start, end);
606 }
607
608 Iterator<Int32x4> get iterator => new _TypedListIterator<Int32x4>(this);
609 }
610
611
612 class _Float64x2ListMixin {
613 Iterable<Float64x2> where(bool f(int element)) =>
614 new WhereIterable<Float64x2>(this, f);
615
616 Iterable<Float64x2> take(int n) => new SubListIterable<Float64x2>(this, 0, n);
617
618 Iterable<Float64x2> takeWhile(bool test(int element)) =>
619 new TakeWhileIterable<Float64x2>(this, test);
620
621 Iterable<Float64x2> skip(int n) =>
622 new SubListIterable<Float64x2>(this, n, null);
623
624 Iterable<Float64x2> skipWhile(bool test(element)) =>
625 new SkipWhileIterable<Float64x2>(this, test);
626
627 Iterable<Float64x2> get reversed => new ReversedListIterable<Float64x2>(this);
628
629 Map<int, Float64x2> asMap() => new ListMapView<Float64x2>(this);
630
631 Iterable<Float64x2> getRange(int start, [int end]) {
632 RangeError.checkValidRange(start, end, this.length);
633 return new SubListIterable<Float64x2>(this, start, end);
634 }
635
636 Iterator<Float64x2> get iterator => new _TypedListIterator<Float64x2>(this);
637 }
638
639
538 class _ByteBuffer implements ByteBuffer { 640 class _ByteBuffer implements ByteBuffer {
539 final _TypedList _data; 641 final _TypedList _data;
540 642
541 _ByteBuffer(this._data); 643 _ByteBuffer(this._data);
542 644
543 factory _ByteBuffer._New(data) => new _ByteBuffer(data); 645 factory _ByteBuffer._New(data) => new _ByteBuffer(data);
544 646
545 // Forward calls to _data. 647 // Forward calls to _data.
546 int get lengthInBytes => _data.lengthInBytes; 648 int get lengthInBytes => _data.lengthInBytes;
547 int get hashCode => _data.hashCode; 649 int get hashCode => _data.hashCode;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 Int32x4 _getInt32x4(int offsetInBytes) native "TypedData_GetInt32x4"; 825 Int32x4 _getInt32x4(int offsetInBytes) native "TypedData_GetInt32x4";
724 void _setInt32x4(int offsetInBytes, Int32x4 value) 826 void _setInt32x4(int offsetInBytes, Int32x4 value)
725 native "TypedData_SetInt32x4"; 827 native "TypedData_SetInt32x4";
726 828
727 Float64x2 _getFloat64x2(int offsetInBytes) native "TypedData_GetFloat64x2"; 829 Float64x2 _getFloat64x2(int offsetInBytes) native "TypedData_GetFloat64x2";
728 void _setFloat64x2(int offsetInBytes, Float64x2 value) 830 void _setFloat64x2(int offsetInBytes, Float64x2 value)
729 native "TypedData_SetFloat64x2"; 831 native "TypedData_SetFloat64x2";
730 } 832 }
731 833
732 834
733 class _Int8Array extends _TypedList implements Int8List { 835 class _Int8Array extends _TypedList with _IntListMixin implements Int8List {
734 // Factory constructors. 836 // Factory constructors.
735 837
736 factory _Int8Array(int length) { 838 factory _Int8Array(int length) {
737 return _new(length); 839 return _new(length);
738 } 840 }
739 841
740 842
741 // Method(s) implementing List interface. 843 // Method(s) implementing List interface.
742 844
743 int operator[](int index) { 845 int operator[](int index) {
744 if (index < 0 || index >= length) { 846 if (index < 0 || index >= length) {
745 _throwRangeError(index, length); 847 _throwRangeError(index, length);
746 } 848 }
747 return _getInt8(index); 849 return _getInt8(index);
748 } 850 }
749 851
750 void operator[]=(int index, int value) { 852 void operator[]=(int index, int value) {
751 if (index < 0 || index >= length) { 853 if (index < 0 || index >= length) {
752 _throwRangeError(index, length); 854 _throwRangeError(index, length);
753 } 855 }
754 _setInt8(index, _toInt8(value)); 856 _setInt8(index, _toInt8(value));
755 } 857 }
756 858
757 Iterator<int> get iterator {
758 return new _TypedListIterator<int>(this);
759 }
760
761 859
762 // Method(s) implementing TypedData interface. 860 // Method(s) implementing TypedData interface.
763 861
764 int get elementSizeInBytes { 862 int get elementSizeInBytes {
765 return Int8List.BYTES_PER_ELEMENT; 863 return Int8List.BYTES_PER_ELEMENT;
766 } 864 }
767 865
768 866
769 // Internal utility methods. 867 // Internal utility methods.
770 868
771 _Int8Array _createList(int length) { 869 _Int8Array _createList(int length) {
772 return _new(length); 870 return _new(length);
773 } 871 }
774 872
775 static _Int8Array _new(int length) native "TypedData_Int8Array_new"; 873 static _Int8Array _new(int length) native "TypedData_Int8Array_new";
776 } 874 }
777 875
778 876
779 class _Uint8Array extends _TypedList implements Uint8List { 877 class _Uint8Array extends _TypedList with _IntListMixin implements Uint8List {
780 // Factory constructors. 878 // Factory constructors.
781 879
782 factory _Uint8Array(int length) { 880 factory _Uint8Array(int length) {
783 return _new(length); 881 return _new(length);
784 } 882 }
785 883
786 884
787 // Methods implementing List interface. 885 // Methods implementing List interface.
788 int operator[](int index) { 886 int operator[](int index) {
789 if (index < 0 || index >= length) { 887 if (index < 0 || index >= length) {
790 _throwRangeError(index, length); 888 _throwRangeError(index, length);
791 } 889 }
792 return _getUint8(index); 890 return _getUint8(index);
793 } 891 }
794 892
795 void operator[]=(int index, int value) { 893 void operator[]=(int index, int value) {
796 if (index < 0 || index >= length) { 894 if (index < 0 || index >= length) {
797 _throwRangeError(index, length); 895 _throwRangeError(index, length);
798 } 896 }
799 _setUint8(index, _toUint8(value)); 897 _setUint8(index, _toUint8(value));
800 } 898 }
801 899
802 Iterator<int> get iterator {
803 return new _TypedListIterator<int>(this);
804 }
805
806 900
807 // Methods implementing TypedData interface. 901 // Methods implementing TypedData interface.
808 int get elementSizeInBytes { 902 int get elementSizeInBytes {
809 return Uint8List.BYTES_PER_ELEMENT; 903 return Uint8List.BYTES_PER_ELEMENT;
810 } 904 }
811 905
812 906
813 // Internal utility methods. 907 // Internal utility methods.
814 908
815 _Uint8Array _createList(int length) { 909 _Uint8Array _createList(int length) {
816 return _new(length); 910 return _new(length);
817 } 911 }
818 912
819 static _Uint8Array _new(int length) native "TypedData_Uint8Array_new"; 913 static _Uint8Array _new(int length) native "TypedData_Uint8Array_new";
820 } 914 }
821 915
822 916
823 class _Uint8ClampedArray extends _TypedList implements Uint8ClampedList { 917 class _Uint8ClampedArray extends _TypedList with _IntListMixin implements Uint8C lampedList {
824 // Factory constructors. 918 // Factory constructors.
825 919
826 factory _Uint8ClampedArray(int length) { 920 factory _Uint8ClampedArray(int length) {
827 return _new(length); 921 return _new(length);
828 } 922 }
829 923
830 // Methods implementing List interface. 924 // Methods implementing List interface.
831 925
832 int operator[](int index) { 926 int operator[](int index) {
833 if (index < 0 || index >= length) { 927 if (index < 0 || index >= length) {
834 _throwRangeError(index, length); 928 _throwRangeError(index, length);
835 } 929 }
836 return _getUint8(index); 930 return _getUint8(index);
837 } 931 }
838 932
839 void operator[]=(int index, int value) { 933 void operator[]=(int index, int value) {
840 if (index < 0 || index >= length) { 934 if (index < 0 || index >= length) {
841 _throwRangeError(index, length); 935 _throwRangeError(index, length);
842 } 936 }
843 _setUint8(index, _toClampedUint8(value)); 937 _setUint8(index, _toClampedUint8(value));
844 } 938 }
845 939
846 Iterator<int> get iterator {
847 return new _TypedListIterator<int>(this);
848 }
849
850 940
851 // Methods implementing TypedData interface. 941 // Methods implementing TypedData interface.
852 int get elementSizeInBytes { 942 int get elementSizeInBytes {
853 return Uint8List.BYTES_PER_ELEMENT; 943 return Uint8List.BYTES_PER_ELEMENT;
854 } 944 }
855 945
856 946
857 // Internal utility methods. 947 // Internal utility methods.
858 948
859 _Uint8ClampedArray _createList(int length) { 949 _Uint8ClampedArray _createList(int length) {
860 return _new(length); 950 return _new(length);
861 } 951 }
862 952
863 static _Uint8ClampedArray _new(int length) 953 static _Uint8ClampedArray _new(int length)
864 native "TypedData_Uint8ClampedArray_new"; 954 native "TypedData_Uint8ClampedArray_new";
865 } 955 }
866 956
867 957
868 class _Int16Array extends _TypedList implements Int16List { 958 class _Int16Array extends _TypedList with _IntListMixin implements Int16List {
869 // Factory constructors. 959 // Factory constructors.
870 960
871 factory _Int16Array(int length) { 961 factory _Int16Array(int length) {
872 return _new(length); 962 return _new(length);
873 } 963 }
874 964
875 965
876 // Method(s) implementing List interface. 966 // Method(s) implementing List interface.
877 967
878 int operator[](int index) { 968 int operator[](int index) {
879 if (index < 0 || index >= length) { 969 if (index < 0 || index >= length) {
880 _throwRangeError(index, length); 970 _throwRangeError(index, length);
881 } 971 }
882 return _getIndexedInt16(index); 972 return _getIndexedInt16(index);
883 } 973 }
884 974
885 void operator[]=(int index, int value) { 975 void operator[]=(int index, int value) {
886 if (index < 0 || index >= length) { 976 if (index < 0 || index >= length) {
887 _throwRangeError(index, length); 977 _throwRangeError(index, length);
888 } 978 }
889 _setIndexedInt16(index, _toInt16(value)); 979 _setIndexedInt16(index, _toInt16(value));
890 } 980 }
891 981
892 Iterator<int> get iterator {
893 return new _TypedListIterator<int>(this);
894 }
895
896 982
897 // Method(s) implementing TypedData interface. 983 // Method(s) implementing TypedData interface.
898 984
899 int get elementSizeInBytes { 985 int get elementSizeInBytes {
900 return Int16List.BYTES_PER_ELEMENT; 986 return Int16List.BYTES_PER_ELEMENT;
901 } 987 }
902 988
903 989
904 // Internal utility methods. 990 // Internal utility methods.
905 991
906 _Int16Array _createList(int length) { 992 _Int16Array _createList(int length) {
907 return _new(length); 993 return _new(length);
908 } 994 }
909 995
910 int _getIndexedInt16(int index) { 996 int _getIndexedInt16(int index) {
911 return _getInt16(index * Int16List.BYTES_PER_ELEMENT); 997 return _getInt16(index * Int16List.BYTES_PER_ELEMENT);
912 } 998 }
913 999
914 void _setIndexedInt16(int index, int value) { 1000 void _setIndexedInt16(int index, int value) {
915 _setInt16(index * Int16List.BYTES_PER_ELEMENT, value); 1001 _setInt16(index * Int16List.BYTES_PER_ELEMENT, value);
916 } 1002 }
917 1003
918 static _Int16Array _new(int length) native "TypedData_Int16Array_new"; 1004 static _Int16Array _new(int length) native "TypedData_Int16Array_new";
919 } 1005 }
920 1006
921 1007
922 class _Uint16Array extends _TypedList implements Uint16List { 1008 class _Uint16Array extends _TypedList with _IntListMixin implements Uint16List {
923 // Factory constructors. 1009 // Factory constructors.
924 1010
925 factory _Uint16Array(int length) { 1011 factory _Uint16Array(int length) {
926 return _new(length); 1012 return _new(length);
927 } 1013 }
928 1014
929 1015
930 // Method(s) implementing the List interface. 1016 // Method(s) implementing the List interface.
931 1017
932 int operator[](int index) { 1018 int operator[](int index) {
933 if (index < 0 || index >= length) { 1019 if (index < 0 || index >= length) {
934 _throwRangeError(index, length); 1020 _throwRangeError(index, length);
935 } 1021 }
936 return _getIndexedUint16(index); 1022 return _getIndexedUint16(index);
937 } 1023 }
938 1024
939 void operator[]=(int index, int value) { 1025 void operator[]=(int index, int value) {
940 if (index < 0 || index >= length) { 1026 if (index < 0 || index >= length) {
941 _throwRangeError(index, length); 1027 _throwRangeError(index, length);
942 } 1028 }
943 _setIndexedUint16(index, _toUint16(value)); 1029 _setIndexedUint16(index, _toUint16(value));
944 } 1030 }
945 1031
946 Iterator<int> get iterator {
947 return new _TypedListIterator<int>(this);
948 }
949
950 1032
951 // Method(s) implementing the TypedData interface. 1033 // Method(s) implementing the TypedData interface.
952 1034
953 int get elementSizeInBytes { 1035 int get elementSizeInBytes {
954 return Uint16List.BYTES_PER_ELEMENT; 1036 return Uint16List.BYTES_PER_ELEMENT;
955 } 1037 }
956 1038
957 1039
958 // Internal utility methods. 1040 // Internal utility methods.
959 1041
960 _Uint16Array _createList(int length) { 1042 _Uint16Array _createList(int length) {
961 return _new(length); 1043 return _new(length);
962 } 1044 }
963 1045
964 int _getIndexedUint16(int index) { 1046 int _getIndexedUint16(int index) {
965 return _getUint16(index * Uint16List.BYTES_PER_ELEMENT); 1047 return _getUint16(index * Uint16List.BYTES_PER_ELEMENT);
966 } 1048 }
967 1049
968 void _setIndexedUint16(int index, int value) { 1050 void _setIndexedUint16(int index, int value) {
969 _setUint16(index * Uint16List.BYTES_PER_ELEMENT, value); 1051 _setUint16(index * Uint16List.BYTES_PER_ELEMENT, value);
970 } 1052 }
971 1053
972 static _Uint16Array _new(int length) native "TypedData_Uint16Array_new"; 1054 static _Uint16Array _new(int length) native "TypedData_Uint16Array_new";
973 } 1055 }
974 1056
975 1057
976 class _Int32Array extends _TypedList implements Int32List { 1058 class _Int32Array extends _TypedList with _IntListMixin implements Int32List {
977 // Factory constructors. 1059 // Factory constructors.
978 1060
979 factory _Int32Array(int length) { 1061 factory _Int32Array(int length) {
980 return _new(length); 1062 return _new(length);
981 } 1063 }
982 1064
983 1065
984 // Method(s) implementing the List interface. 1066 // Method(s) implementing the List interface.
985 1067
986 int operator[](int index) { 1068 int operator[](int index) {
987 if (index < 0 || index >= length) { 1069 if (index < 0 || index >= length) {
988 _throwRangeError(index, length); 1070 _throwRangeError(index, length);
989 } 1071 }
990 return _getIndexedInt32(index); 1072 return _getIndexedInt32(index);
991 } 1073 }
992 1074
993 void operator[]=(int index, int value) { 1075 void operator[]=(int index, int value) {
994 if (index < 0 || index >= length) { 1076 if (index < 0 || index >= length) {
995 _throwRangeError(index, length); 1077 _throwRangeError(index, length);
996 } 1078 }
997 _setIndexedInt32(index, _toInt32(value)); 1079 _setIndexedInt32(index, _toInt32(value));
998 } 1080 }
999 1081
1000 Iterator<int> get iterator {
1001 return new _TypedListIterator<int>(this);
1002 }
1003
1004 1082
1005 // Method(s) implementing TypedData interface. 1083 // Method(s) implementing TypedData interface.
1006 1084
1007 int get elementSizeInBytes { 1085 int get elementSizeInBytes {
1008 return Int32List.BYTES_PER_ELEMENT; 1086 return Int32List.BYTES_PER_ELEMENT;
1009 } 1087 }
1010 1088
1011 1089
1012 // Internal utility methods. 1090 // Internal utility methods.
1013 1091
1014 _Int32Array _createList(int length) { 1092 _Int32Array _createList(int length) {
1015 return _new(length); 1093 return _new(length);
1016 } 1094 }
1017 1095
1018 int _getIndexedInt32(int index) { 1096 int _getIndexedInt32(int index) {
1019 return _getInt32(index * Int32List.BYTES_PER_ELEMENT); 1097 return _getInt32(index * Int32List.BYTES_PER_ELEMENT);
1020 } 1098 }
1021 1099
1022 void _setIndexedInt32(int index, int value) { 1100 void _setIndexedInt32(int index, int value) {
1023 _setInt32(index * Int32List.BYTES_PER_ELEMENT, value); 1101 _setInt32(index * Int32List.BYTES_PER_ELEMENT, value);
1024 } 1102 }
1025 1103
1026 static _Int32Array _new(int length) native "TypedData_Int32Array_new"; 1104 static _Int32Array _new(int length) native "TypedData_Int32Array_new";
1027 } 1105 }
1028 1106
1029 1107
1030 class _Uint32Array extends _TypedList implements Uint32List { 1108 class _Uint32Array extends _TypedList with _IntListMixin implements Uint32List {
1031 // Factory constructors. 1109 // Factory constructors.
1032 1110
1033 factory _Uint32Array(int length) { 1111 factory _Uint32Array(int length) {
1034 return _new(length); 1112 return _new(length);
1035 } 1113 }
1036 1114
1037 1115
1038 // Method(s) implementing the List interface. 1116 // Method(s) implementing the List interface.
1039 1117
1040 int operator[](int index) { 1118 int operator[](int index) {
1041 if (index < 0 || index >= length) { 1119 if (index < 0 || index >= length) {
1042 _throwRangeError(index, length); 1120 _throwRangeError(index, length);
1043 } 1121 }
1044 return _getIndexedUint32(index); 1122 return _getIndexedUint32(index);
1045 } 1123 }
1046 1124
1047 void operator[]=(int index, int value) { 1125 void operator[]=(int index, int value) {
1048 if (index < 0 || index >= length) { 1126 if (index < 0 || index >= length) {
1049 _throwRangeError(index, length); 1127 _throwRangeError(index, length);
1050 } 1128 }
1051 _setIndexedUint32(index, _toUint32(value)); 1129 _setIndexedUint32(index, _toUint32(value));
1052 } 1130 }
1053 1131
1054 Iterator<int> get iterator {
1055 return new _TypedListIterator<int>(this);
1056 }
1057
1058 1132
1059 // Method(s) implementing the TypedData interface. 1133 // Method(s) implementing the TypedData interface.
1060 1134
1061 int get elementSizeInBytes { 1135 int get elementSizeInBytes {
1062 return Uint32List.BYTES_PER_ELEMENT; 1136 return Uint32List.BYTES_PER_ELEMENT;
1063 } 1137 }
1064 1138
1065 1139
1066 // Internal utility methods. 1140 // Internal utility methods.
1067 1141
1068 _Uint32Array _createList(int length) { 1142 _Uint32Array _createList(int length) {
1069 return _new(length); 1143 return _new(length);
1070 } 1144 }
1071 1145
1072 int _getIndexedUint32(int index) { 1146 int _getIndexedUint32(int index) {
1073 return _getUint32(index * Uint32List.BYTES_PER_ELEMENT); 1147 return _getUint32(index * Uint32List.BYTES_PER_ELEMENT);
1074 } 1148 }
1075 1149
1076 void _setIndexedUint32(int index, int value) { 1150 void _setIndexedUint32(int index, int value) {
1077 _setInt32(index * Uint32List.BYTES_PER_ELEMENT, value); 1151 _setInt32(index * Uint32List.BYTES_PER_ELEMENT, value);
1078 } 1152 }
1079 1153
1080 static _Uint32Array _new(int length) native "TypedData_Uint32Array_new"; 1154 static _Uint32Array _new(int length) native "TypedData_Uint32Array_new";
1081 } 1155 }
1082 1156
1083 1157
1084 class _Int64Array extends _TypedList implements Int64List { 1158 class _Int64Array extends _TypedList with _IntListMixin implements Int64List {
1085 // Factory constructors. 1159 // Factory constructors.
1086 1160
1087 factory _Int64Array(int length) { 1161 factory _Int64Array(int length) {
1088 return _new(length); 1162 return _new(length);
1089 } 1163 }
1090 1164
1091 1165
1092 // Method(s) implementing the List interface. 1166 // Method(s) implementing the List interface.
1093 1167
1094 int operator[](int index) { 1168 int operator[](int index) {
1095 if (index < 0 || index >= length) { 1169 if (index < 0 || index >= length) {
1096 _throwRangeError(index, length); 1170 _throwRangeError(index, length);
1097 } 1171 }
1098 return _getIndexedInt64(index); 1172 return _getIndexedInt64(index);
1099 } 1173 }
1100 1174
1101 void operator[]=(int index, int value) { 1175 void operator[]=(int index, int value) {
1102 if (index < 0 || index >= length) { 1176 if (index < 0 || index >= length) {
1103 _throwRangeError(index, length); 1177 _throwRangeError(index, length);
1104 } 1178 }
1105 _setIndexedInt64(index, _toInt64(value)); 1179 _setIndexedInt64(index, _toInt64(value));
1106 } 1180 }
1107 1181
1108 Iterator<int> get iterator {
1109 return new _TypedListIterator<int>(this);
1110 }
1111
1112 1182
1113 // Method(s) implementing the TypedData interface. 1183 // Method(s) implementing the TypedData interface.
1114 1184
1115 int get elementSizeInBytes { 1185 int get elementSizeInBytes {
1116 return Int64List.BYTES_PER_ELEMENT; 1186 return Int64List.BYTES_PER_ELEMENT;
1117 } 1187 }
1118 1188
1119 1189
1120 // Internal utility methods. 1190 // Internal utility methods.
1121 1191
1122 _Int64Array _createList(int length) { 1192 _Int64Array _createList(int length) {
1123 return _new(length); 1193 return _new(length);
1124 } 1194 }
1125 1195
1126 int _getIndexedInt64(int index) { 1196 int _getIndexedInt64(int index) {
1127 return _getInt64(index * Int64List.BYTES_PER_ELEMENT); 1197 return _getInt64(index * Int64List.BYTES_PER_ELEMENT);
1128 } 1198 }
1129 1199
1130 void _setIndexedInt64(int index, int value) { 1200 void _setIndexedInt64(int index, int value) {
1131 _setInt64(index * Int64List.BYTES_PER_ELEMENT, value); 1201 _setInt64(index * Int64List.BYTES_PER_ELEMENT, value);
1132 } 1202 }
1133 1203
1134 static _Int64Array _new(int length) native "TypedData_Int64Array_new"; 1204 static _Int64Array _new(int length) native "TypedData_Int64Array_new";
1135 } 1205 }
1136 1206
1137 1207
1138 class _Uint64Array extends _TypedList implements Uint64List { 1208 class _Uint64Array extends _TypedList with _IntListMixin implements Uint64List {
1139 // Factory constructors. 1209 // Factory constructors.
1140 1210
1141 factory _Uint64Array(int length) { 1211 factory _Uint64Array(int length) {
1142 return _new(length); 1212 return _new(length);
1143 } 1213 }
1144 1214
1145 1215
1146 // Method(s) implementing the List interface. 1216 // Method(s) implementing the List interface.
1147 1217
1148 int operator[](int index) { 1218 int operator[](int index) {
1149 if (index < 0 || index >= length) { 1219 if (index < 0 || index >= length) {
1150 _throwRangeError(index, length); 1220 _throwRangeError(index, length);
1151 } 1221 }
1152 return _getIndexedUint64(index); 1222 return _getIndexedUint64(index);
1153 } 1223 }
1154 1224
1155 void operator[]=(int index, int value) { 1225 void operator[]=(int index, int value) {
1156 if (index < 0 || index >= length) { 1226 if (index < 0 || index >= length) {
1157 _throwRangeError(index, length); 1227 _throwRangeError(index, length);
1158 } 1228 }
1159 _setIndexedUint64(index, _toUint64(value)); 1229 _setIndexedUint64(index, _toUint64(value));
1160 } 1230 }
1161 1231
1162 Iterator<int> get iterator {
1163 return new _TypedListIterator<int>(this);
1164 }
1165
1166 1232
1167 // Method(s) implementing the TypedData interface. 1233 // Method(s) implementing the TypedData interface.
1168 1234
1169 int get elementSizeInBytes { 1235 int get elementSizeInBytes {
1170 return Uint64List.BYTES_PER_ELEMENT; 1236 return Uint64List.BYTES_PER_ELEMENT;
1171 } 1237 }
1172 1238
1173 1239
1174 // Internal utility methods. 1240 // Internal utility methods.
1175 1241
1176 _Uint64Array _createList(int length) { 1242 _Uint64Array _createList(int length) {
1177 return _new(length); 1243 return _new(length);
1178 } 1244 }
1179 1245
1180 int _getIndexedUint64(int index) { 1246 int _getIndexedUint64(int index) {
1181 return _getUint64(index * Uint64List.BYTES_PER_ELEMENT); 1247 return _getUint64(index * Uint64List.BYTES_PER_ELEMENT);
1182 } 1248 }
1183 1249
1184 void _setIndexedUint64(int index, int value) { 1250 void _setIndexedUint64(int index, int value) {
1185 _setUint64(index * Uint64List.BYTES_PER_ELEMENT, value); 1251 _setUint64(index * Uint64List.BYTES_PER_ELEMENT, value);
1186 } 1252 }
1187 1253
1188 static _Uint64Array _new(int length) native "TypedData_Uint64Array_new"; 1254 static _Uint64Array _new(int length) native "TypedData_Uint64Array_new";
1189 } 1255 }
1190 1256
1191 1257
1192 class _Float32Array extends _TypedList implements Float32List { 1258 class _Float32Array extends _TypedList with _DoubleListMixin implements Float32L ist {
1193 // Factory constructors. 1259 // Factory constructors.
1194 1260
1195 factory _Float32Array(int length) { 1261 factory _Float32Array(int length) {
1196 return _new(length); 1262 return _new(length);
1197 } 1263 }
1198 1264
1199 1265
1200 // Method(s) implementing the List interface. 1266 // Method(s) implementing the List interface.
1201 1267
1202 double operator[](int index) { 1268 double operator[](int index) {
1203 if (index < 0 || index >= length) { 1269 if (index < 0 || index >= length) {
1204 _throwRangeError(index, length); 1270 _throwRangeError(index, length);
1205 } 1271 }
1206 return _getIndexedFloat32(index); 1272 return _getIndexedFloat32(index);
1207 } 1273 }
1208 1274
1209 void operator[]=(int index, double value) { 1275 void operator[]=(int index, double value) {
1210 if (index < 0 || index >= length) { 1276 if (index < 0 || index >= length) {
1211 _throwRangeError(index, length); 1277 _throwRangeError(index, length);
1212 } 1278 }
1213 _setIndexedFloat32(index, value); 1279 _setIndexedFloat32(index, value);
1214 } 1280 }
1215 1281
1216 Iterator<double> get iterator {
1217 return new _TypedListIterator<double>(this);
1218 }
1219
1220 1282
1221 // Method(s) implementing the TypedData interface. 1283 // Method(s) implementing the TypedData interface.
1222 1284
1223 int get elementSizeInBytes { 1285 int get elementSizeInBytes {
1224 return Float32List.BYTES_PER_ELEMENT; 1286 return Float32List.BYTES_PER_ELEMENT;
1225 } 1287 }
1226 1288
1227 1289
1228 // Internal utility methods. 1290 // Internal utility methods.
1229 1291
1230 _Float32Array _createList(int length) { 1292 _Float32Array _createList(int length) {
1231 return _new(length); 1293 return _new(length);
1232 } 1294 }
1233 1295
1234 double _getIndexedFloat32(int index) { 1296 double _getIndexedFloat32(int index) {
1235 return _getFloat32(index * Float32List.BYTES_PER_ELEMENT); 1297 return _getFloat32(index * Float32List.BYTES_PER_ELEMENT);
1236 } 1298 }
1237 1299
1238 void _setIndexedFloat32(int index, double value) { 1300 void _setIndexedFloat32(int index, double value) {
1239 _setFloat32(index * Float32List.BYTES_PER_ELEMENT, value); 1301 _setFloat32(index * Float32List.BYTES_PER_ELEMENT, value);
1240 } 1302 }
1241 1303
1242 static _Float32Array _new(int length) native "TypedData_Float32Array_new"; 1304 static _Float32Array _new(int length) native "TypedData_Float32Array_new";
1243 } 1305 }
1244 1306
1245 1307
1246 class _Float64Array extends _TypedList implements Float64List { 1308 class _Float64Array extends _TypedList with _DoubleListMixin implements Float64L ist {
1247 // Factory constructors. 1309 // Factory constructors.
1248 1310
1249 factory _Float64Array(int length) { 1311 factory _Float64Array(int length) {
1250 return _new(length); 1312 return _new(length);
1251 } 1313 }
1252 1314
1253 1315
1254 // Method(s) implementing the List interface. 1316 // Method(s) implementing the List interface.
1255 1317
1256 double operator[](int index) { 1318 double operator[](int index) {
1257 if (index < 0 || index >= length) { 1319 if (index < 0 || index >= length) {
1258 _throwRangeError(index, length); 1320 _throwRangeError(index, length);
1259 } 1321 }
1260 return _getIndexedFloat64(index); 1322 return _getIndexedFloat64(index);
1261 } 1323 }
1262 1324
1263 void operator[]=(int index, double value) { 1325 void operator[]=(int index, double value) {
1264 if (index < 0 || index >= length) { 1326 if (index < 0 || index >= length) {
1265 _throwRangeError(index, length); 1327 _throwRangeError(index, length);
1266 } 1328 }
1267 _setIndexedFloat64(index, value); 1329 _setIndexedFloat64(index, value);
1268 } 1330 }
1269 1331
1270 Iterator<double> get iterator {
1271 return new _TypedListIterator<double>(this);
1272 }
1273
1274 1332
1275 // Method(s) implementing the TypedData interface. 1333 // Method(s) implementing the TypedData interface.
1276 1334
1277 int get elementSizeInBytes { 1335 int get elementSizeInBytes {
1278 return Float64List.BYTES_PER_ELEMENT; 1336 return Float64List.BYTES_PER_ELEMENT;
1279 } 1337 }
1280 1338
1281 1339
1282 // Internal utility methods. 1340 // Internal utility methods.
1283 1341
1284 _Float64Array _createList(int length) { 1342 _Float64Array _createList(int length) {
1285 return _new(length); 1343 return _new(length);
1286 } 1344 }
1287 1345
1288 double _getIndexedFloat64(int index) { 1346 double _getIndexedFloat64(int index) {
1289 return _getFloat64(index * Float64List.BYTES_PER_ELEMENT); 1347 return _getFloat64(index * Float64List.BYTES_PER_ELEMENT);
1290 } 1348 }
1291 1349
1292 void _setIndexedFloat64(int index, double value) { 1350 void _setIndexedFloat64(int index, double value) {
1293 _setFloat64(index * Float64List.BYTES_PER_ELEMENT, value); 1351 _setFloat64(index * Float64List.BYTES_PER_ELEMENT, value);
1294 } 1352 }
1295 1353
1296 static _Float64Array _new(int length) native "TypedData_Float64Array_new"; 1354 static _Float64Array _new(int length) native "TypedData_Float64Array_new";
1297 } 1355 }
1298 1356
1299 1357
1300 class _Float32x4Array extends _TypedList implements Float32x4List { 1358 class _Float32x4Array extends _TypedList with _Float32x4ListMixin implements Flo at32x4List {
1301 // Factory constructors. 1359 // Factory constructors.
1302 1360
1303 factory _Float32x4Array(int length) { 1361 factory _Float32x4Array(int length) {
1304 return _new(length); 1362 return _new(length);
1305 } 1363 }
1306 1364
1307 1365
1308 Float32x4 operator[](int index) { 1366 Float32x4 operator[](int index) {
1309 if (index < 0 || index >= length) { 1367 if (index < 0 || index >= length) {
1310 _throwRangeError(index, length); 1368 _throwRangeError(index, length);
1311 } 1369 }
1312 return _getIndexedFloat32x4(index); 1370 return _getIndexedFloat32x4(index);
1313 } 1371 }
1314 1372
1315 void operator[]=(int index, Float32x4 value) { 1373 void operator[]=(int index, Float32x4 value) {
1316 if (index < 0 || index >= length) { 1374 if (index < 0 || index >= length) {
1317 _throwRangeError(index, length); 1375 _throwRangeError(index, length);
1318 } 1376 }
1319 _setIndexedFloat32x4(index, value); 1377 _setIndexedFloat32x4(index, value);
1320 } 1378 }
1321 1379
1322 Iterator<Float32x4> get iterator {
1323 return new _TypedListIterator<Float32x4>(this);
1324 }
1325
1326 1380
1327 // Method(s) implementing the TypedData interface. 1381 // Method(s) implementing the TypedData interface.
1328 1382
1329 int get elementSizeInBytes { 1383 int get elementSizeInBytes {
1330 return Float32x4List.BYTES_PER_ELEMENT; 1384 return Float32x4List.BYTES_PER_ELEMENT;
1331 } 1385 }
1332 1386
1333 1387
1334 // Internal utility methods. 1388 // Internal utility methods.
1335 1389
1336 _Float32x4Array _createList(int length) { 1390 _Float32x4Array _createList(int length) {
1337 return _new(length); 1391 return _new(length);
1338 } 1392 }
1339 1393
1340 Float32x4 _getIndexedFloat32x4(int index) { 1394 Float32x4 _getIndexedFloat32x4(int index) {
1341 return _getFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT); 1395 return _getFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT);
1342 } 1396 }
1343 1397
1344 void _setIndexedFloat32x4(int index, Float32x4 value) { 1398 void _setIndexedFloat32x4(int index, Float32x4 value) {
1345 _setFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT, value); 1399 _setFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT, value);
1346 } 1400 }
1347 1401
1348 static _Float32x4Array _new(int length) native "TypedData_Float32x4Array_new"; 1402 static _Float32x4Array _new(int length) native "TypedData_Float32x4Array_new";
1349 } 1403 }
1350 1404
1351 1405
1352 class _Int32x4Array extends _TypedList implements Int32x4List { 1406 class _Int32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4 List {
1353 // Factory constructors. 1407 // Factory constructors.
1354 1408
1355 factory _Int32x4Array(int length) { 1409 factory _Int32x4Array(int length) {
1356 return _new(length); 1410 return _new(length);
1357 } 1411 }
1358 1412
1359 1413
1360 Int32x4 operator[](int index) { 1414 Int32x4 operator[](int index) {
1361 if (index < 0 || index >= length) { 1415 if (index < 0 || index >= length) {
1362 _throwRangeError(index, length); 1416 _throwRangeError(index, length);
1363 } 1417 }
1364 return _getIndexedInt32x4(index); 1418 return _getIndexedInt32x4(index);
1365 } 1419 }
1366 1420
1367 void operator[]=(int index, Int32x4 value) { 1421 void operator[]=(int index, Int32x4 value) {
1368 if (index < 0 || index >= length) { 1422 if (index < 0 || index >= length) {
1369 _throwRangeError(index, length); 1423 _throwRangeError(index, length);
1370 } 1424 }
1371 _setIndexedInt32x4(index, value); 1425 _setIndexedInt32x4(index, value);
1372 } 1426 }
1373 1427
1374 Iterator<Int32x4> get iterator {
1375 return new _TypedListIterator<Int32x4>(this);
1376 }
1377
1378 1428
1379 // Method(s) implementing the TypedData interface. 1429 // Method(s) implementing the TypedData interface.
1380 1430
1381 int get elementSizeInBytes { 1431 int get elementSizeInBytes {
1382 return Int32x4List.BYTES_PER_ELEMENT; 1432 return Int32x4List.BYTES_PER_ELEMENT;
1383 } 1433 }
1384 1434
1385 1435
1386 // Internal utility methods. 1436 // Internal utility methods.
1387 1437
1388 _Int32x4Array _createList(int length) { 1438 _Int32x4Array _createList(int length) {
1389 return _new(length); 1439 return _new(length);
1390 } 1440 }
1391 1441
1392 Int32x4 _getIndexedInt32x4(int index) { 1442 Int32x4 _getIndexedInt32x4(int index) {
1393 return _getInt32x4(index * Int32x4List.BYTES_PER_ELEMENT); 1443 return _getInt32x4(index * Int32x4List.BYTES_PER_ELEMENT);
1394 } 1444 }
1395 1445
1396 void _setIndexedInt32x4(int index, Int32x4 value) { 1446 void _setIndexedInt32x4(int index, Int32x4 value) {
1397 _setInt32x4(index * Int32x4List.BYTES_PER_ELEMENT, value); 1447 _setInt32x4(index * Int32x4List.BYTES_PER_ELEMENT, value);
1398 } 1448 }
1399 1449
1400 static _Int32x4Array _new(int length) native "TypedData_Int32x4Array_new"; 1450 static _Int32x4Array _new(int length) native "TypedData_Int32x4Array_new";
1401 } 1451 }
1402 1452
1403 1453
1404 class _Float64x2Array extends _TypedList implements Float64x2List { 1454 class _Float64x2Array extends _TypedList with _Float64x2ListMixin implements Flo at64x2List {
1405 // Factory constructors. 1455 // Factory constructors.
1406 1456
1407 factory _Float64x2Array(int length) { 1457 factory _Float64x2Array(int length) {
1408 return _new(length); 1458 return _new(length);
1409 } 1459 }
1410 1460
1411 1461
1412 Float64x2 operator[](int index) { 1462 Float64x2 operator[](int index) {
1413 if (index < 0 || index >= length) { 1463 if (index < 0 || index >= length) {
1414 _throwRangeError(index, length); 1464 _throwRangeError(index, length);
1415 } 1465 }
1416 return _getIndexedFloat64x2(index); 1466 return _getIndexedFloat64x2(index);
1417 } 1467 }
1418 1468
1419 void operator[]=(int index, Float64x2 value) { 1469 void operator[]=(int index, Float64x2 value) {
1420 if (index < 0 || index >= length) { 1470 if (index < 0 || index >= length) {
1421 _throwRangeError(index, length); 1471 _throwRangeError(index, length);
1422 } 1472 }
1423 _setIndexedFloat64x2(index, value); 1473 _setIndexedFloat64x2(index, value);
1424 } 1474 }
1425 1475
1426 Iterator<Float64x2> get iterator {
1427 return new _TypedListIterator<Float64x2>(this);
1428 }
1429
1430 1476
1431 // Method(s) implementing the TypedData interface. 1477 // Method(s) implementing the TypedData interface.
1432 1478
1433 int get elementSizeInBytes { 1479 int get elementSizeInBytes {
1434 return Float64x2List.BYTES_PER_ELEMENT; 1480 return Float64x2List.BYTES_PER_ELEMENT;
1435 } 1481 }
1436 1482
1437 1483
1438 // Internal utility methods. 1484 // Internal utility methods.
1439 1485
1440 _Float64x2Array _createList(int length) { 1486 _Float64x2Array _createList(int length) {
1441 return _new(length); 1487 return _new(length);
1442 } 1488 }
1443 1489
1444 Float64x2 _getIndexedFloat64x2(int index) { 1490 Float64x2 _getIndexedFloat64x2(int index) {
1445 return _getFloat64x2(index * Float64x2List.BYTES_PER_ELEMENT); 1491 return _getFloat64x2(index * Float64x2List.BYTES_PER_ELEMENT);
1446 } 1492 }
1447 1493
1448 void _setIndexedFloat64x2(int index, Float64x2 value) { 1494 void _setIndexedFloat64x2(int index, Float64x2 value) {
1449 _setFloat64x2(index * Float64x2List.BYTES_PER_ELEMENT, value); 1495 _setFloat64x2(index * Float64x2List.BYTES_PER_ELEMENT, value);
1450 } 1496 }
1451 1497
1452 static _Float64x2Array _new(int length) native "TypedData_Float64x2Array_new"; 1498 static _Float64x2Array _new(int length) native "TypedData_Float64x2Array_new";
1453 } 1499 }
1454 1500
1455 1501
1456 class _ExternalInt8Array extends _TypedList implements Int8List { 1502 class _ExternalInt8Array extends _TypedList with _IntListMixin implements Int8Li st {
1457 // Factory constructors. 1503 // Factory constructors.
1458 1504
1459 factory _ExternalInt8Array(int length) { 1505 factory _ExternalInt8Array(int length) {
1460 return _new(length); 1506 return _new(length);
1461 } 1507 }
1462 1508
1463 1509
1464 // Method(s) implementing the List interface. 1510 // Method(s) implementing the List interface.
1465 int operator[](int index) { 1511 int operator[](int index) {
1466 if (index < 0 || index >= length) { 1512 if (index < 0 || index >= length) {
1467 _throwRangeError(index, length); 1513 _throwRangeError(index, length);
1468 } 1514 }
1469 return _getInt8(index); 1515 return _getInt8(index);
1470 } 1516 }
1471 1517
1472 void operator[]=(int index, int value) { 1518 void operator[]=(int index, int value) {
1473 if (index < 0 || index >= length) { 1519 if (index < 0 || index >= length) {
1474 _throwRangeError(index, length); 1520 _throwRangeError(index, length);
1475 } 1521 }
1476 _setInt8(index, value); 1522 _setInt8(index, value);
1477 } 1523 }
1478 1524
1479 Iterator<int> get iterator {
1480 return new _TypedListIterator<int>(this);
1481 }
1482
1483 1525
1484 // Method(s) implementing the TypedData interface. 1526 // Method(s) implementing the TypedData interface.
1485 1527
1486 int get elementSizeInBytes { 1528 int get elementSizeInBytes {
1487 return Int8List.BYTES_PER_ELEMENT; 1529 return Int8List.BYTES_PER_ELEMENT;
1488 } 1530 }
1489 1531
1490 1532
1491 // Internal utility methods. 1533 // Internal utility methods.
1492 1534
1493 Int8List _createList(int length) { 1535 Int8List _createList(int length) {
1494 return new Int8List(length); 1536 return new Int8List(length);
1495 } 1537 }
1496 1538
1497 static _ExternalInt8Array _new(int length) native 1539 static _ExternalInt8Array _new(int length) native
1498 "ExternalTypedData_Int8Array_new"; 1540 "ExternalTypedData_Int8Array_new";
1499 } 1541 }
1500 1542
1501 1543
1502 class _ExternalUint8Array extends _TypedList implements Uint8List { 1544 class _ExternalUint8Array extends _TypedList with _IntListMixin implements Uint8 List {
1503 // Factory constructors. 1545 // Factory constructors.
1504 1546
1505 factory _ExternalUint8Array(int length) { 1547 factory _ExternalUint8Array(int length) {
1506 return _new(length); 1548 return _new(length);
1507 } 1549 }
1508 1550
1509 1551
1510 // Method(s) implementing the List interface. 1552 // Method(s) implementing the List interface.
1511 1553
1512 int operator[](int index) { 1554 int operator[](int index) {
1513 if (index < 0 || index >= length) { 1555 if (index < 0 || index >= length) {
1514 _throwRangeError(index, length); 1556 _throwRangeError(index, length);
1515 } 1557 }
1516 return _getUint8(index); 1558 return _getUint8(index);
1517 } 1559 }
1518 1560
1519 void operator[]=(int index, int value) { 1561 void operator[]=(int index, int value) {
1520 if (index < 0 || index >= length) { 1562 if (index < 0 || index >= length) {
1521 _throwRangeError(index, length); 1563 _throwRangeError(index, length);
1522 } 1564 }
1523 _setUint8(index, _toUint8(value)); 1565 _setUint8(index, _toUint8(value));
1524 } 1566 }
1525 1567
1526 Iterator<int> get iterator {
1527 return new _TypedListIterator<int>(this);
1528 }
1529
1530 1568
1531 // Method(s) implementing the TypedData interface. 1569 // Method(s) implementing the TypedData interface.
1532 1570
1533 int get elementSizeInBytes { 1571 int get elementSizeInBytes {
1534 return Uint8List.BYTES_PER_ELEMENT; 1572 return Uint8List.BYTES_PER_ELEMENT;
1535 } 1573 }
1536 1574
1537 1575
1538 // Internal utility methods. 1576 // Internal utility methods.
1539 1577
1540 Uint8List _createList(int length) { 1578 Uint8List _createList(int length) {
1541 return new Uint8List(length); 1579 return new Uint8List(length);
1542 } 1580 }
1543 1581
1544 static _ExternalUint8Array _new(int length) native 1582 static _ExternalUint8Array _new(int length) native
1545 "ExternalTypedData_Uint8Array_new"; 1583 "ExternalTypedData_Uint8Array_new";
1546 } 1584 }
1547 1585
1548 1586
1549 class _ExternalUint8ClampedArray extends _TypedList implements Uint8ClampedList { 1587 class _ExternalUint8ClampedArray extends _TypedList with _IntListMixin implement s Uint8ClampedList {
1550 // Factory constructors. 1588 // Factory constructors.
1551 1589
1552 factory _ExternalUint8ClampedArray(int length) { 1590 factory _ExternalUint8ClampedArray(int length) {
1553 return _new(length); 1591 return _new(length);
1554 } 1592 }
1555 1593
1556 // Method(s) implementing the List interface. 1594 // Method(s) implementing the List interface.
1557 1595
1558 int operator[](int index) { 1596 int operator[](int index) {
1559 if (index < 0 || index >= length) { 1597 if (index < 0 || index >= length) {
1560 _throwRangeError(index, length); 1598 _throwRangeError(index, length);
1561 } 1599 }
1562 return _getUint8(index); 1600 return _getUint8(index);
1563 } 1601 }
1564 1602
1565 void operator[]=(int index, int value) { 1603 void operator[]=(int index, int value) {
1566 if (index < 0 || index >= length) { 1604 if (index < 0 || index >= length) {
1567 _throwRangeError(index, length); 1605 _throwRangeError(index, length);
1568 } 1606 }
1569 _setUint8(index, _toClampedUint8(value)); 1607 _setUint8(index, _toClampedUint8(value));
1570 } 1608 }
1571 1609
1572 Iterator<int> get iterator {
1573 return new _TypedListIterator<int>(this);
1574 }
1575
1576 1610
1577 // Method(s) implementing the TypedData interface. 1611 // Method(s) implementing the TypedData interface.
1578 1612
1579 int get elementSizeInBytes { 1613 int get elementSizeInBytes {
1580 return Uint8List.BYTES_PER_ELEMENT; 1614 return Uint8List.BYTES_PER_ELEMENT;
1581 } 1615 }
1582 1616
1583 1617
1584 // Internal utility methods. 1618 // Internal utility methods.
1585 1619
1586 Uint8ClampedList _createList(int length) { 1620 Uint8ClampedList _createList(int length) {
1587 return new Uint8ClampedList(length); 1621 return new Uint8ClampedList(length);
1588 } 1622 }
1589 1623
1590 static _ExternalUint8ClampedArray _new(int length) native 1624 static _ExternalUint8ClampedArray _new(int length) native
1591 "ExternalTypedData_Uint8ClampedArray_new"; 1625 "ExternalTypedData_Uint8ClampedArray_new";
1592 } 1626 }
1593 1627
1594 1628
1595 class _ExternalInt16Array extends _TypedList implements Int16List { 1629 class _ExternalInt16Array extends _TypedList with _IntListMixin implements Int16 List {
1596 // Factory constructors. 1630 // Factory constructors.
1597 1631
1598 factory _ExternalInt16Array(int length) { 1632 factory _ExternalInt16Array(int length) {
1599 return _new(length); 1633 return _new(length);
1600 } 1634 }
1601 1635
1602 1636
1603 // Method(s) implementing the List interface. 1637 // Method(s) implementing the List interface.
1604 1638
1605 int operator[](int index) { 1639 int operator[](int index) {
1606 if (index < 0 || index >= length) { 1640 if (index < 0 || index >= length) {
1607 _throwRangeError(index, length); 1641 _throwRangeError(index, length);
1608 } 1642 }
1609 return _getIndexedInt16(index); 1643 return _getIndexedInt16(index);
1610 } 1644 }
1611 1645
1612 void operator[]=(int index, int value) { 1646 void operator[]=(int index, int value) {
1613 if (index < 0 || index >= length) { 1647 if (index < 0 || index >= length) {
1614 _throwRangeError(index, length); 1648 _throwRangeError(index, length);
1615 } 1649 }
1616 _setIndexedInt16(index, _toInt16(value)); 1650 _setIndexedInt16(index, _toInt16(value));
1617 } 1651 }
1618 1652
1619 Iterator<int> get iterator {
1620 return new _TypedListIterator<int>(this);
1621 }
1622
1623 1653
1624 // Method(s) implementing the TypedData interface. 1654 // Method(s) implementing the TypedData interface.
1625 1655
1626 int get elementSizeInBytes { 1656 int get elementSizeInBytes {
1627 return Int16List.BYTES_PER_ELEMENT; 1657 return Int16List.BYTES_PER_ELEMENT;
1628 } 1658 }
1629 1659
1630 1660
1631 // Internal utility methods. 1661 // Internal utility methods.
1632 1662
1633 Int16List _createList(int length) { 1663 Int16List _createList(int length) {
1634 return new Int16List(length); 1664 return new Int16List(length);
1635 } 1665 }
1636 1666
1637 int _getIndexedInt16(int index) { 1667 int _getIndexedInt16(int index) {
1638 return _getInt16(index * Int16List.BYTES_PER_ELEMENT); 1668 return _getInt16(index * Int16List.BYTES_PER_ELEMENT);
1639 } 1669 }
1640 1670
1641 void _setIndexedInt16(int index, int value) { 1671 void _setIndexedInt16(int index, int value) {
1642 _setInt16(index * Int16List.BYTES_PER_ELEMENT, value); 1672 _setInt16(index * Int16List.BYTES_PER_ELEMENT, value);
1643 } 1673 }
1644 1674
1645 static _ExternalInt16Array _new(int length) native 1675 static _ExternalInt16Array _new(int length) native
1646 "ExternalTypedData_Int16Array_new"; 1676 "ExternalTypedData_Int16Array_new";
1647 } 1677 }
1648 1678
1649 1679
1650 class _ExternalUint16Array extends _TypedList implements Uint16List { 1680 class _ExternalUint16Array extends _TypedList with _IntListMixin implements Uint 16List {
1651 // Factory constructors. 1681 // Factory constructors.
1652 1682
1653 factory _ExternalUint16Array(int length) { 1683 factory _ExternalUint16Array(int length) {
1654 return _new(length); 1684 return _new(length);
1655 } 1685 }
1656 1686
1657 1687
1658 // Method(s) implementing the List interface. 1688 // Method(s) implementing the List interface.
1659 1689
1660 int operator[](int index) { 1690 int operator[](int index) {
1661 if (index < 0 || index >= length) { 1691 if (index < 0 || index >= length) {
1662 _throwRangeError(index, length); 1692 _throwRangeError(index, length);
1663 } 1693 }
1664 return _getIndexedUint16(index); 1694 return _getIndexedUint16(index);
1665 } 1695 }
1666 1696
1667 void operator[]=(int index, int value) { 1697 void operator[]=(int index, int value) {
1668 if (index < 0 || index >= length) { 1698 if (index < 0 || index >= length) {
1669 _throwRangeError(index, length); 1699 _throwRangeError(index, length);
1670 } 1700 }
1671 _setIndexedUint16(index, _toUint16(value)); 1701 _setIndexedUint16(index, _toUint16(value));
1672 } 1702 }
1673 1703
1674 Iterator<int> get iterator {
1675 return new _TypedListIterator<int>(this);
1676 }
1677
1678 1704
1679 // Method(s) implementing the TypedData interface. 1705 // Method(s) implementing the TypedData interface.
1680 1706
1681 int get elementSizeInBytes { 1707 int get elementSizeInBytes {
1682 return Uint16List.BYTES_PER_ELEMENT; 1708 return Uint16List.BYTES_PER_ELEMENT;
1683 } 1709 }
1684 1710
1685 1711
1686 // Internal utility methods. 1712 // Internal utility methods.
1687 1713
1688 Uint16List _createList(int length) { 1714 Uint16List _createList(int length) {
1689 return new Uint16List(length); 1715 return new Uint16List(length);
1690 } 1716 }
1691 1717
1692 int _getIndexedUint16(int index) { 1718 int _getIndexedUint16(int index) {
1693 return _getUint16(index * Uint16List.BYTES_PER_ELEMENT); 1719 return _getUint16(index * Uint16List.BYTES_PER_ELEMENT);
1694 } 1720 }
1695 1721
1696 void _setIndexedUint16(int index, int value) { 1722 void _setIndexedUint16(int index, int value) {
1697 _setUint16(index * Uint16List.BYTES_PER_ELEMENT, value); 1723 _setUint16(index * Uint16List.BYTES_PER_ELEMENT, value);
1698 } 1724 }
1699 1725
1700 static _ExternalUint16Array _new(int length) native 1726 static _ExternalUint16Array _new(int length) native
1701 "ExternalTypedData_Uint16Array_new"; 1727 "ExternalTypedData_Uint16Array_new";
1702 } 1728 }
1703 1729
1704 1730
1705 class _ExternalInt32Array extends _TypedList implements Int32List { 1731 class _ExternalInt32Array extends _TypedList with _IntListMixin implements Int32 List {
1706 // Factory constructors. 1732 // Factory constructors.
1707 1733
1708 factory _ExternalInt32Array(int length) { 1734 factory _ExternalInt32Array(int length) {
1709 return _new(length); 1735 return _new(length);
1710 } 1736 }
1711 1737
1712 1738
1713 // Method(s) implementing the List interface. 1739 // Method(s) implementing the List interface.
1714 1740
1715 int operator[](int index) { 1741 int operator[](int index) {
1716 if (index < 0 || index >= length) { 1742 if (index < 0 || index >= length) {
1717 _throwRangeError(index, length); 1743 _throwRangeError(index, length);
1718 } 1744 }
1719 return _getIndexedInt32(index); 1745 return _getIndexedInt32(index);
1720 } 1746 }
1721 1747
1722 void operator[]=(int index, int value) { 1748 void operator[]=(int index, int value) {
1723 if (index < 0 || index >= length) { 1749 if (index < 0 || index >= length) {
1724 _throwRangeError(index, length); 1750 _throwRangeError(index, length);
1725 } 1751 }
1726 _setIndexedInt32(index, _toInt32(value)); 1752 _setIndexedInt32(index, _toInt32(value));
1727 } 1753 }
1728 1754
1729 Iterator<int> get iterator {
1730 return new _TypedListIterator<int>(this);
1731 }
1732
1733 1755
1734 // Method(s) implementing the TypedData interface. 1756 // Method(s) implementing the TypedData interface.
1735 1757
1736 int get elementSizeInBytes { 1758 int get elementSizeInBytes {
1737 return Int32List.BYTES_PER_ELEMENT; 1759 return Int32List.BYTES_PER_ELEMENT;
1738 } 1760 }
1739 1761
1740 1762
1741 // Internal utility methods. 1763 // Internal utility methods.
1742 1764
1743 Int32List _createList(int length) { 1765 Int32List _createList(int length) {
1744 return new Int32List(length); 1766 return new Int32List(length);
1745 } 1767 }
1746 1768
1747 int _getIndexedInt32(int index) { 1769 int _getIndexedInt32(int index) {
1748 return _getInt32(index * Int32List.BYTES_PER_ELEMENT); 1770 return _getInt32(index * Int32List.BYTES_PER_ELEMENT);
1749 } 1771 }
1750 1772
1751 void _setIndexedInt32(int index, int value) { 1773 void _setIndexedInt32(int index, int value) {
1752 _setInt32(index * Int32List.BYTES_PER_ELEMENT, value); 1774 _setInt32(index * Int32List.BYTES_PER_ELEMENT, value);
1753 } 1775 }
1754 1776
1755 static _ExternalInt32Array _new(int length) native 1777 static _ExternalInt32Array _new(int length) native
1756 "ExternalTypedData_Int32Array_new"; 1778 "ExternalTypedData_Int32Array_new";
1757 } 1779 }
1758 1780
1759 1781
1760 class _ExternalUint32Array extends _TypedList implements Uint32List { 1782 class _ExternalUint32Array extends _TypedList with _IntListMixin implements Uint 32List {
1761 // Factory constructors. 1783 // Factory constructors.
1762 1784
1763 factory _ExternalUint32Array(int length) { 1785 factory _ExternalUint32Array(int length) {
1764 return _new(length); 1786 return _new(length);
1765 } 1787 }
1766 1788
1767 1789
1768 // Method(s) implementing the List interface. 1790 // Method(s) implementing the List interface.
1769 1791
1770 int operator[](int index) { 1792 int operator[](int index) {
1771 if (index < 0 || index >= length) { 1793 if (index < 0 || index >= length) {
1772 _throwRangeError(index, length); 1794 _throwRangeError(index, length);
1773 } 1795 }
1774 return _getIndexedUint32(index); 1796 return _getIndexedUint32(index);
1775 } 1797 }
1776 1798
1777 void operator[]=(int index, int value) { 1799 void operator[]=(int index, int value) {
1778 if (index < 0 || index >= length) { 1800 if (index < 0 || index >= length) {
1779 _throwRangeError(index, length); 1801 _throwRangeError(index, length);
1780 } 1802 }
1781 _setIndexedUint32(index, _toUint32(value)); 1803 _setIndexedUint32(index, _toUint32(value));
1782 } 1804 }
1783 1805
1784 Iterator<int> get iterator {
1785 return new _TypedListIterator<int>(this);
1786 }
1787
1788 1806
1789 // Method(s) implementing the TypedData interface. 1807 // Method(s) implementing the TypedData interface.
1790 1808
1791 int get elementSizeInBytes { 1809 int get elementSizeInBytes {
1792 return Uint32List.BYTES_PER_ELEMENT; 1810 return Uint32List.BYTES_PER_ELEMENT;
1793 } 1811 }
1794 1812
1795 1813
1796 // Internal utility methods. 1814 // Internal utility methods.
1797 1815
1798 Uint32List _createList(int length) { 1816 Uint32List _createList(int length) {
1799 return new Uint32List(length); 1817 return new Uint32List(length);
1800 } 1818 }
1801 1819
1802 int _getIndexedUint32(int index) { 1820 int _getIndexedUint32(int index) {
1803 return _getUint32(index * Uint32List.BYTES_PER_ELEMENT); 1821 return _getUint32(index * Uint32List.BYTES_PER_ELEMENT);
1804 } 1822 }
1805 1823
1806 void _setIndexedUint32(int index, int value) { 1824 void _setIndexedUint32(int index, int value) {
1807 _setInt32(index * Uint32List.BYTES_PER_ELEMENT, value); 1825 _setInt32(index * Uint32List.BYTES_PER_ELEMENT, value);
1808 } 1826 }
1809 1827
1810 static _ExternalUint32Array _new(int length) native 1828 static _ExternalUint32Array _new(int length) native
1811 "ExternalTypedData_Uint32Array_new"; 1829 "ExternalTypedData_Uint32Array_new";
1812 } 1830 }
1813 1831
1814 1832
1815 class _ExternalInt64Array extends _TypedList implements Int64List { 1833 class _ExternalInt64Array extends _TypedList with _IntListMixin implements Int64 List {
1816 // Factory constructors. 1834 // Factory constructors.
1817 1835
1818 factory _ExternalInt64Array(int length) { 1836 factory _ExternalInt64Array(int length) {
1819 return _new(length); 1837 return _new(length);
1820 } 1838 }
1821 1839
1822 1840
1823 // Method(s) implementing the List interface. 1841 // Method(s) implementing the List interface.
1824 1842
1825 int operator[](int index) { 1843 int operator[](int index) {
1826 if (index < 0 || index >= length) { 1844 if (index < 0 || index >= length) {
1827 _throwRangeError(index, length); 1845 _throwRangeError(index, length);
1828 } 1846 }
1829 return _getIndexedInt64(index); 1847 return _getIndexedInt64(index);
1830 } 1848 }
1831 1849
1832 void operator[]=(int index, int value) { 1850 void operator[]=(int index, int value) {
1833 if (index < 0 || index >= length) { 1851 if (index < 0 || index >= length) {
1834 _throwRangeError(index, length); 1852 _throwRangeError(index, length);
1835 } 1853 }
1836 _setIndexedInt64(index, _toInt64(value)); 1854 _setIndexedInt64(index, _toInt64(value));
1837 } 1855 }
1838 1856
1839 Iterator<int> get iterator {
1840 return new _TypedListIterator<int>(this);
1841 }
1842
1843 1857
1844 // Method(s) implementing the TypedData interface. 1858 // Method(s) implementing the TypedData interface.
1845 1859
1846 int get elementSizeInBytes { 1860 int get elementSizeInBytes {
1847 return Int64List.BYTES_PER_ELEMENT; 1861 return Int64List.BYTES_PER_ELEMENT;
1848 } 1862 }
1849 1863
1850 1864
1851 // Internal utility methods. 1865 // Internal utility methods.
1852 1866
1853 Int64List _createList(int length) { 1867 Int64List _createList(int length) {
1854 return new Int64List(length); 1868 return new Int64List(length);
1855 } 1869 }
1856 1870
1857 int _getIndexedInt64(int index) { 1871 int _getIndexedInt64(int index) {
1858 return _getInt64(index * Int64List.BYTES_PER_ELEMENT); 1872 return _getInt64(index * Int64List.BYTES_PER_ELEMENT);
1859 } 1873 }
1860 1874
1861 void _setIndexedInt64(int index, int value) { 1875 void _setIndexedInt64(int index, int value) {
1862 _setInt64(index * Int64List.BYTES_PER_ELEMENT, value); 1876 _setInt64(index * Int64List.BYTES_PER_ELEMENT, value);
1863 } 1877 }
1864 1878
1865 static _ExternalInt64Array _new(int length) native 1879 static _ExternalInt64Array _new(int length) native
1866 "ExternalTypedData_Int64Array_new"; 1880 "ExternalTypedData_Int64Array_new";
1867 } 1881 }
1868 1882
1869 1883
1870 class _ExternalUint64Array extends _TypedList implements Uint64List { 1884 class _ExternalUint64Array extends _TypedList with _IntListMixin implements Uint 64List {
1871 // Factory constructors. 1885 // Factory constructors.
1872 1886
1873 factory _ExternalUint64Array(int length) { 1887 factory _ExternalUint64Array(int length) {
1874 return _new(length); 1888 return _new(length);
1875 } 1889 }
1876 1890
1877 1891
1878 // Method(s) implementing the List interface. 1892 // Method(s) implementing the List interface.
1879 1893
1880 int operator[](int index) { 1894 int operator[](int index) {
1881 if (index < 0 || index >= length) { 1895 if (index < 0 || index >= length) {
1882 _throwRangeError(index, length); 1896 _throwRangeError(index, length);
1883 } 1897 }
1884 return _getIndexedUint64(index); 1898 return _getIndexedUint64(index);
1885 } 1899 }
1886 1900
1887 void operator[]=(int index, int value) { 1901 void operator[]=(int index, int value) {
1888 if (index < 0 || index >= length) { 1902 if (index < 0 || index >= length) {
1889 _throwRangeError(index, length); 1903 _throwRangeError(index, length);
1890 } 1904 }
1891 _setIndexedUint64(index, _toUint64(value)); 1905 _setIndexedUint64(index, _toUint64(value));
1892 } 1906 }
1893 1907
1894 Iterator<int> get iterator {
1895 return new _TypedListIterator<int>(this);
1896 }
1897
1898 1908
1899 // Method(s) implementing the TypedData interface. 1909 // Method(s) implementing the TypedData interface.
1900 1910
1901 int get elementSizeInBytes { 1911 int get elementSizeInBytes {
1902 return Uint64List.BYTES_PER_ELEMENT; 1912 return Uint64List.BYTES_PER_ELEMENT;
1903 } 1913 }
1904 1914
1905 1915
1906 // Internal utility methods. 1916 // Internal utility methods.
1907 1917
1908 Uint64List _createList(int length) { 1918 Uint64List _createList(int length) {
1909 return new Uint64List(length); 1919 return new Uint64List(length);
1910 } 1920 }
1911 1921
1912 int _getIndexedUint64(int index) { 1922 int _getIndexedUint64(int index) {
1913 return _getUint64(index * Uint64List.BYTES_PER_ELEMENT); 1923 return _getUint64(index * Uint64List.BYTES_PER_ELEMENT);
1914 } 1924 }
1915 1925
1916 void _setIndexedUint64(int index, int value) { 1926 void _setIndexedUint64(int index, int value) {
1917 _setUint64(index * Uint64List.BYTES_PER_ELEMENT, value); 1927 _setUint64(index * Uint64List.BYTES_PER_ELEMENT, value);
1918 } 1928 }
1919 1929
1920 static _ExternalUint64Array _new(int length) native 1930 static _ExternalUint64Array _new(int length) native
1921 "ExternalTypedData_Uint64Array_new"; 1931 "ExternalTypedData_Uint64Array_new";
1922 } 1932 }
1923 1933
1924 1934
1925 class _ExternalFloat32Array extends _TypedList implements Float32List { 1935 class _ExternalFloat32Array extends _TypedList with _DoubleListMixin implements Float32List {
1926 // Factory constructors. 1936 // Factory constructors.
1927 1937
1928 factory _ExternalFloat32Array(int length) { 1938 factory _ExternalFloat32Array(int length) {
1929 return _new(length); 1939 return _new(length);
1930 } 1940 }
1931 1941
1932 1942
1933 // Method(s) implementing the List interface. 1943 // Method(s) implementing the List interface.
1934 1944
1935 double operator[](int index) { 1945 double operator[](int index) {
1936 if (index < 0 || index >= length) { 1946 if (index < 0 || index >= length) {
1937 _throwRangeError(index, length); 1947 _throwRangeError(index, length);
1938 } 1948 }
1939 return _getIndexedFloat32(index); 1949 return _getIndexedFloat32(index);
1940 } 1950 }
1941 1951
1942 void operator[]=(int index, double value) { 1952 void operator[]=(int index, double value) {
1943 if (index < 0 || index >= length) { 1953 if (index < 0 || index >= length) {
1944 _throwRangeError(index, length); 1954 _throwRangeError(index, length);
1945 } 1955 }
1946 _setIndexedFloat32(index, value); 1956 _setIndexedFloat32(index, value);
1947 } 1957 }
1948 1958
1949 Iterator<double> get iterator {
1950 return new _TypedListIterator<double>(this);
1951 }
1952
1953 1959
1954 // Method(s) implementing the TypedData interface. 1960 // Method(s) implementing the TypedData interface.
1955 1961
1956 int get elementSizeInBytes { 1962 int get elementSizeInBytes {
1957 return Float32List.BYTES_PER_ELEMENT; 1963 return Float32List.BYTES_PER_ELEMENT;
1958 } 1964 }
1959 1965
1960 1966
1961 // Internal utility methods. 1967 // Internal utility methods.
1962 1968
1963 Float32List _createList(int length) { 1969 Float32List _createList(int length) {
1964 return new Float32List(length); 1970 return new Float32List(length);
1965 } 1971 }
1966 1972
1967 double _getIndexedFloat32(int index) { 1973 double _getIndexedFloat32(int index) {
1968 return _getFloat32(index * Float32List.BYTES_PER_ELEMENT); 1974 return _getFloat32(index * Float32List.BYTES_PER_ELEMENT);
1969 } 1975 }
1970 1976
1971 void _setIndexedFloat32(int index, double value) { 1977 void _setIndexedFloat32(int index, double value) {
1972 _setFloat32(index * Float32List.BYTES_PER_ELEMENT, value); 1978 _setFloat32(index * Float32List.BYTES_PER_ELEMENT, value);
1973 } 1979 }
1974 1980
1975 static _ExternalFloat32Array _new(int length) native 1981 static _ExternalFloat32Array _new(int length) native
1976 "ExternalTypedData_Float32Array_new"; 1982 "ExternalTypedData_Float32Array_new";
1977 } 1983 }
1978 1984
1979 1985
1980 class _ExternalFloat64Array extends _TypedList implements Float64List { 1986 class _ExternalFloat64Array extends _TypedList with _DoubleListMixin implements Float64List {
1981 // Factory constructors. 1987 // Factory constructors.
1982 1988
1983 factory _ExternalFloat64Array(int length) { 1989 factory _ExternalFloat64Array(int length) {
1984 return _new(length); 1990 return _new(length);
1985 } 1991 }
1986 1992
1987 1993
1988 // Method(s) implementing the List interface. 1994 // Method(s) implementing the List interface.
1989 1995
1990 double operator[](int index) { 1996 double operator[](int index) {
1991 if (index < 0 || index >= length) { 1997 if (index < 0 || index >= length) {
1992 _throwRangeError(index, length); 1998 _throwRangeError(index, length);
1993 } 1999 }
1994 return _getIndexedFloat64(index); 2000 return _getIndexedFloat64(index);
1995 } 2001 }
1996 2002
1997 void operator[]=(int index, double value) { 2003 void operator[]=(int index, double value) {
1998 if (index < 0 || index >= length) { 2004 if (index < 0 || index >= length) {
1999 _throwRangeError(index, length); 2005 _throwRangeError(index, length);
2000 } 2006 }
2001 _setIndexedFloat64(index, value); 2007 _setIndexedFloat64(index, value);
2002 } 2008 }
2003 2009
2004 Iterator<double> get iterator {
2005 return new _TypedListIterator<double>(this);
2006 }
2007
2008 2010
2009 // Method(s) implementing the TypedData interface. 2011 // Method(s) implementing the TypedData interface.
2010 2012
2011 int get elementSizeInBytes { 2013 int get elementSizeInBytes {
2012 return Float64List.BYTES_PER_ELEMENT; 2014 return Float64List.BYTES_PER_ELEMENT;
2013 } 2015 }
2014 2016
2015 2017
2016 // Internal utility methods. 2018 // Internal utility methods.
2017 2019
2018 Float64List _createList(int length) { 2020 Float64List _createList(int length) {
2019 return new Float64List(length); 2021 return new Float64List(length);
2020 } 2022 }
2021 2023
2022 double _getIndexedFloat64(int index) { 2024 double _getIndexedFloat64(int index) {
2023 return _getFloat64(index * Float64List.BYTES_PER_ELEMENT); 2025 return _getFloat64(index * Float64List.BYTES_PER_ELEMENT);
2024 } 2026 }
2025 2027
2026 void _setIndexedFloat64(int index, double value) { 2028 void _setIndexedFloat64(int index, double value) {
2027 _setFloat64(index * Float64List.BYTES_PER_ELEMENT, value); 2029 _setFloat64(index * Float64List.BYTES_PER_ELEMENT, value);
2028 } 2030 }
2029 2031
2030 static _ExternalFloat64Array _new(int length) native 2032 static _ExternalFloat64Array _new(int length) native
2031 "ExternalTypedData_Float64Array_new"; 2033 "ExternalTypedData_Float64Array_new";
2032 } 2034 }
2033 2035
2034 2036
2035 class _ExternalFloat32x4Array extends _TypedList implements Float32x4List { 2037 class _ExternalFloat32x4Array extends _TypedList with _Float32x4ListMixin implem ents Float32x4List {
2036 // Factory constructors. 2038 // Factory constructors.
2037 2039
2038 factory _ExternalFloat32x4Array(int length) { 2040 factory _ExternalFloat32x4Array(int length) {
2039 return _new(length); 2041 return _new(length);
2040 } 2042 }
2041 2043
2042 2044
2043 // Method(s) implementing the List interface. 2045 // Method(s) implementing the List interface.
2044 2046
2045 Float32x4 operator[](int index) { 2047 Float32x4 operator[](int index) {
2046 if (index < 0 || index >= length) { 2048 if (index < 0 || index >= length) {
2047 _throwRangeError(index, length); 2049 _throwRangeError(index, length);
2048 } 2050 }
2049 return _getIndexedFloat32x4(index); 2051 return _getIndexedFloat32x4(index);
2050 } 2052 }
2051 2053
2052 void operator[]=(int index, Float32x4 value) { 2054 void operator[]=(int index, Float32x4 value) {
2053 if (index < 0 || index >= length) { 2055 if (index < 0 || index >= length) {
2054 _throwRangeError(index, length); 2056 _throwRangeError(index, length);
2055 } 2057 }
2056 _setIndexedFloat32x4(index, value); 2058 _setIndexedFloat32x4(index, value);
2057 } 2059 }
2058 2060
2059 Iterator<Float32x4> get iterator {
2060 return new _TypedListIterator<Float32x4>(this);
2061 }
2062
2063 2061
2064 // Method(s) implementing the TypedData interface. 2062 // Method(s) implementing the TypedData interface.
2065 2063
2066 int get elementSizeInBytes { 2064 int get elementSizeInBytes {
2067 return Float32x4List.BYTES_PER_ELEMENT; 2065 return Float32x4List.BYTES_PER_ELEMENT;
2068 } 2066 }
2069 2067
2070 2068
2071 // Internal utility methods. 2069 // Internal utility methods.
2072 2070
2073 Float32x4List _createList(int length) { 2071 Float32x4List _createList(int length) {
2074 return new Float32x4List(length); 2072 return new Float32x4List(length);
2075 } 2073 }
2076 2074
2077 Float32x4 _getIndexedFloat32x4(int index) { 2075 Float32x4 _getIndexedFloat32x4(int index) {
2078 return _getFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT); 2076 return _getFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT);
2079 } 2077 }
2080 2078
2081 void _setIndexedFloat32x4(int index, Float32x4 value) { 2079 void _setIndexedFloat32x4(int index, Float32x4 value) {
2082 _setFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT, value); 2080 _setFloat32x4(index * Float32x4List.BYTES_PER_ELEMENT, value);
2083 } 2081 }
2084 2082
2085 static _ExternalFloat32x4Array _new(int length) native 2083 static _ExternalFloat32x4Array _new(int length) native
2086 "ExternalTypedData_Float32x4Array_new"; 2084 "ExternalTypedData_Float32x4Array_new";
2087 } 2085 }
2088 2086
2089 2087
2090 class _ExternalInt32x4Array extends _TypedList implements Int32x4List { 2088 class _ExternalInt32x4Array extends _TypedList with _Int32x4ListMixin implements Int32x4List {
2091 // Factory constructors. 2089 // Factory constructors.
2092 2090
2093 factory _ExternalInt32x4Array(int length) { 2091 factory _ExternalInt32x4Array(int length) {
2094 return _new(length); 2092 return _new(length);
2095 } 2093 }
2096 2094
2097 2095
2098 // Method(s) implementing the List interface. 2096 // Method(s) implementing the List interface.
2099 2097
2100 Int32x4 operator[](int index) { 2098 Int32x4 operator[](int index) {
2101 if (index < 0 || index >= length) { 2099 if (index < 0 || index >= length) {
2102 _throwRangeError(index, length); 2100 _throwRangeError(index, length);
2103 } 2101 }
2104 return _getIndexedInt32x4(index); 2102 return _getIndexedInt32x4(index);
2105 } 2103 }
2106 2104
2107 void operator[]=(int index, Int32x4 value) { 2105 void operator[]=(int index, Int32x4 value) {
2108 if (index < 0 || index >= length) { 2106 if (index < 0 || index >= length) {
2109 _throwRangeError(index, length); 2107 _throwRangeError(index, length);
2110 } 2108 }
2111 _setIndexedInt32x4(index, value); 2109 _setIndexedInt32x4(index, value);
2112 } 2110 }
2113 2111
2114 Iterator<Int32x4> get iterator {
2115 return new _TypedListIterator<Int32x4>(this);
2116 }
2117
2118 2112
2119 // Method(s) implementing the TypedData interface. 2113 // Method(s) implementing the TypedData interface.
2120 2114
2121 int get elementSizeInBytes { 2115 int get elementSizeInBytes {
2122 return Int32x4List.BYTES_PER_ELEMENT; 2116 return Int32x4List.BYTES_PER_ELEMENT;
2123 } 2117 }
2124 2118
2125 2119
2126 // Internal utility methods. 2120 // Internal utility methods.
2127 2121
2128 Int32x4List _createList(int length) { 2122 Int32x4List _createList(int length) {
2129 return new Int32x4List(length); 2123 return new Int32x4List(length);
2130 } 2124 }
2131 2125
2132 Int32x4 _getIndexedInt32x4(int index) { 2126 Int32x4 _getIndexedInt32x4(int index) {
2133 return _getInt32x4(index * Int32x4List.BYTES_PER_ELEMENT); 2127 return _getInt32x4(index * Int32x4List.BYTES_PER_ELEMENT);
2134 } 2128 }
2135 2129
2136 void _setIndexedInt32x4(int index, Int32x4 value) { 2130 void _setIndexedInt32x4(int index, Int32x4 value) {
2137 _setInt32x4(index * Int32x4List.BYTES_PER_ELEMENT, value); 2131 _setInt32x4(index * Int32x4List.BYTES_PER_ELEMENT, value);
2138 } 2132 }
2139 2133
2140 static _ExternalInt32x4Array _new(int length) native 2134 static _ExternalInt32x4Array _new(int length) native
2141 "ExternalTypedData_Int32x4Array_new"; 2135 "ExternalTypedData_Int32x4Array_new";
2142 } 2136 }
2143 2137
2144 2138
2145 class _ExternalFloat64x2Array extends _TypedList implements Float64x2List { 2139 class _ExternalFloat64x2Array extends _TypedList with _Float64x2ListMixin implem ents Float64x2List {
2146 // Factory constructors. 2140 // Factory constructors.
2147 2141
2148 factory _ExternalFloat64x2Array(int length) { 2142 factory _ExternalFloat64x2Array(int length) {
2149 return _new(length); 2143 return _new(length);
2150 } 2144 }
2151 2145
2152 2146
2153 // Method(s) implementing the List interface. 2147 // Method(s) implementing the List interface.
2154 2148
2155 Float64x2 operator[](int index) { 2149 Float64x2 operator[](int index) {
2156 if (index < 0 || index >= length) { 2150 if (index < 0 || index >= length) {
2157 _throwRangeError(index, length); 2151 _throwRangeError(index, length);
2158 } 2152 }
2159 return _getIndexedFloat64x2(index); 2153 return _getIndexedFloat64x2(index);
2160 } 2154 }
2161 2155
2162 void operator[]=(int index, Float64x2 value) { 2156 void operator[]=(int index, Float64x2 value) {
2163 if (index < 0 || index >= length) { 2157 if (index < 0 || index >= length) {
2164 _throwRangeError(index, length); 2158 _throwRangeError(index, length);
2165 } 2159 }
2166 _setIndexedFloat64x2(index, value); 2160 _setIndexedFloat64x2(index, value);
2167 } 2161 }
2168 2162
2169 Iterator<Float64x2> get iterator {
2170 return new _TypedListIterator<Float64x2>(this);
2171 }
2172
2173 2163
2174 // Method(s) implementing the TypedData interface. 2164 // Method(s) implementing the TypedData interface.
2175 2165
2176 int get elementSizeInBytes { 2166 int get elementSizeInBytes {
2177 return Float64x2List.BYTES_PER_ELEMENT; 2167 return Float64x2List.BYTES_PER_ELEMENT;
2178 } 2168 }
2179 2169
2180 2170
2181 // Internal utility methods. 2171 // Internal utility methods.
2182 2172
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2462 ByteBuffer get buffer { 2452 ByteBuffer get buffer {
2463 return _typedData.buffer; 2453 return _typedData.buffer;
2464 } 2454 }
2465 2455
2466 final TypedData _typedData; 2456 final TypedData _typedData;
2467 final int offsetInBytes; 2457 final int offsetInBytes;
2468 final int length; 2458 final int length;
2469 } 2459 }
2470 2460
2471 2461
2472 class _Int8ArrayView extends _TypedListView implements Int8List { 2462 class _Int8ArrayView extends _TypedListView with _IntListMixin implements Int8Li st {
2473 // Constructor. 2463 // Constructor.
2474 _Int8ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2464 _Int8ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2475 : super(buffer, _offsetInBytes, 2465 : super(buffer, _offsetInBytes,
2476 _defaultIfNull(_length, 2466 _defaultIfNull(_length,
2477 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2467 ((buffer.lengthInBytes - _offsetInBytes) ~/
2478 Int8List.BYTES_PER_ELEMENT))) { 2468 Int8List.BYTES_PER_ELEMENT))) {
2479 _rangeCheck(buffer.lengthInBytes, 2469 _rangeCheck(buffer.lengthInBytes,
2480 _offsetInBytes, 2470 _offsetInBytes,
2481 length * Int8List.BYTES_PER_ELEMENT); 2471 length * Int8List.BYTES_PER_ELEMENT);
2482 } 2472 }
(...skipping 10 matching lines...) Expand all
2493 } 2483 }
2494 2484
2495 void operator[]=(int index, int value) { 2485 void operator[]=(int index, int value) {
2496 if (index < 0 || index >= length) { 2486 if (index < 0 || index >= length) {
2497 _throwRangeError(index, length); 2487 _throwRangeError(index, length);
2498 } 2488 }
2499 _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT), 2489 _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT),
2500 _toInt8(value)); 2490 _toInt8(value));
2501 } 2491 }
2502 2492
2503 Iterator<int> get iterator {
2504 return new _TypedListIterator<int>(this);
2505 }
2506
2507 2493
2508 // Method(s) implementing TypedData interface. 2494 // Method(s) implementing TypedData interface.
2509 2495
2510 int get elementSizeInBytes { 2496 int get elementSizeInBytes {
2511 return Int8List.BYTES_PER_ELEMENT; 2497 return Int8List.BYTES_PER_ELEMENT;
2512 } 2498 }
2513 2499
2514 2500
2515 // Internal utility methods. 2501 // Internal utility methods.
2516 2502
2517 Int8List _createList(int length) { 2503 Int8List _createList(int length) {
2518 return new Int8List(length); 2504 return new Int8List(length);
2519 } 2505 }
2520 } 2506 }
2521 2507
2522 2508
2523 class _Uint8ArrayView extends _TypedListView implements Uint8List { 2509 class _Uint8ArrayView extends _TypedListView with _IntListMixin implements Uint8 List {
2524 // Constructor. 2510 // Constructor.
2525 _Uint8ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2511 _Uint8ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2526 : super(buffer, _offsetInBytes, 2512 : super(buffer, _offsetInBytes,
2527 _defaultIfNull(_length, 2513 _defaultIfNull(_length,
2528 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2514 ((buffer.lengthInBytes - _offsetInBytes) ~/
2529 Uint8List.BYTES_PER_ELEMENT))) { 2515 Uint8List.BYTES_PER_ELEMENT))) {
2530 _rangeCheck(buffer.lengthInBytes, 2516 _rangeCheck(buffer.lengthInBytes,
2531 _offsetInBytes, 2517 _offsetInBytes,
2532 length * Uint8List.BYTES_PER_ELEMENT); 2518 length * Uint8List.BYTES_PER_ELEMENT);
2533 } 2519 }
(...skipping 10 matching lines...) Expand all
2544 } 2530 }
2545 2531
2546 void operator[]=(int index, int value) { 2532 void operator[]=(int index, int value) {
2547 if (index < 0 || index >= length) { 2533 if (index < 0 || index >= length) {
2548 _throwRangeError(index, length); 2534 _throwRangeError(index, length);
2549 } 2535 }
2550 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), 2536 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
2551 _toUint8(value)); 2537 _toUint8(value));
2552 } 2538 }
2553 2539
2554 Iterator<int> get iterator {
2555 return new _TypedListIterator<int>(this);
2556 }
2557
2558 2540
2559 // Method(s) implementing TypedData interface. 2541 // Method(s) implementing TypedData interface.
2560 2542
2561 int get elementSizeInBytes { 2543 int get elementSizeInBytes {
2562 return Uint8List.BYTES_PER_ELEMENT; 2544 return Uint8List.BYTES_PER_ELEMENT;
2563 } 2545 }
2564 2546
2565 2547
2566 // Internal utility methods. 2548 // Internal utility methods.
2567 2549
2568 Uint8List _createList(int length) { 2550 Uint8List _createList(int length) {
2569 return new Uint8List(length); 2551 return new Uint8List(length);
2570 } 2552 }
2571 } 2553 }
2572 2554
2573 2555
2574 class _Uint8ClampedArrayView extends _TypedListView implements Uint8ClampedList { 2556 class _Uint8ClampedArrayView extends _TypedListView with _IntListMixin implement s Uint8ClampedList {
2575 // Constructor. 2557 // Constructor.
2576 _Uint8ClampedArrayView(ByteBuffer buffer, 2558 _Uint8ClampedArrayView(ByteBuffer buffer,
2577 [int _offsetInBytes = 0, int _length]) 2559 [int _offsetInBytes = 0, int _length])
2578 : super(buffer, _offsetInBytes, 2560 : super(buffer, _offsetInBytes,
2579 _defaultIfNull(_length, 2561 _defaultIfNull(_length,
2580 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2562 ((buffer.lengthInBytes - _offsetInBytes) ~/
2581 Uint8List.BYTES_PER_ELEMENT))) { 2563 Uint8List.BYTES_PER_ELEMENT))) {
2582 _rangeCheck(buffer.lengthInBytes, 2564 _rangeCheck(buffer.lengthInBytes,
2583 offsetInBytes, 2565 offsetInBytes,
2584 length * Uint8List.BYTES_PER_ELEMENT); 2566 length * Uint8List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2596 } 2578 }
2597 2579
2598 void operator[]=(int index, int value) { 2580 void operator[]=(int index, int value) {
2599 if (index < 0 || index >= length) { 2581 if (index < 0 || index >= length) {
2600 _throwRangeError(index, length); 2582 _throwRangeError(index, length);
2601 } 2583 }
2602 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT), 2584 _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
2603 _toClampedUint8(value)); 2585 _toClampedUint8(value));
2604 } 2586 }
2605 2587
2606 Iterator<int> get iterator {
2607 return new _TypedListIterator<int>(this);
2608 }
2609
2610 2588
2611 // Method(s) implementing TypedData interface. 2589 // Method(s) implementing TypedData interface.
2612 2590
2613 int get elementSizeInBytes { 2591 int get elementSizeInBytes {
2614 return Uint8List.BYTES_PER_ELEMENT; 2592 return Uint8List.BYTES_PER_ELEMENT;
2615 } 2593 }
2616 2594
2617 2595
2618 // Internal utility methods. 2596 // Internal utility methods.
2619 2597
2620 Uint8ClampedList _createList(int length) { 2598 Uint8ClampedList _createList(int length) {
2621 return new Uint8ClampedList(length); 2599 return new Uint8ClampedList(length);
2622 } 2600 }
2623 } 2601 }
2624 2602
2625 2603
2626 class _Int16ArrayView extends _TypedListView implements Int16List { 2604 class _Int16ArrayView extends _TypedListView with _IntListMixin implements Int16 List {
2627 // Constructor. 2605 // Constructor.
2628 _Int16ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2606 _Int16ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2629 : super(buffer, _offsetInBytes, 2607 : super(buffer, _offsetInBytes,
2630 _defaultIfNull(_length, 2608 _defaultIfNull(_length,
2631 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2609 ((buffer.lengthInBytes - _offsetInBytes) ~/
2632 Int16List.BYTES_PER_ELEMENT))) { 2610 Int16List.BYTES_PER_ELEMENT))) {
2633 _rangeCheck(buffer.lengthInBytes, 2611 _rangeCheck(buffer.lengthInBytes,
2634 offsetInBytes, 2612 offsetInBytes,
2635 length * Int16List.BYTES_PER_ELEMENT); 2613 length * Int16List.BYTES_PER_ELEMENT);
2636 _offsetAlignmentCheck(_offsetInBytes, Int16List.BYTES_PER_ELEMENT); 2614 _offsetAlignmentCheck(_offsetInBytes, Int16List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2648 } 2626 }
2649 2627
2650 void operator[]=(int index, int value) { 2628 void operator[]=(int index, int value) {
2651 if (index < 0 || index >= length) { 2629 if (index < 0 || index >= length) {
2652 _throwRangeError(index, length); 2630 _throwRangeError(index, length);
2653 } 2631 }
2654 _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT), 2632 _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT),
2655 _toInt16(value)); 2633 _toInt16(value));
2656 } 2634 }
2657 2635
2658 Iterator<int> get iterator {
2659 return new _TypedListIterator<int>(this);
2660 }
2661
2662 2636
2663 // Method(s) implementing TypedData interface. 2637 // Method(s) implementing TypedData interface.
2664 2638
2665 int get elementSizeInBytes { 2639 int get elementSizeInBytes {
2666 return Int16List.BYTES_PER_ELEMENT; 2640 return Int16List.BYTES_PER_ELEMENT;
2667 } 2641 }
2668 2642
2669 2643
2670 // Internal utility methods. 2644 // Internal utility methods.
2671 2645
2672 Int16List _createList(int length) { 2646 Int16List _createList(int length) {
2673 return new Int16List(length); 2647 return new Int16List(length);
2674 } 2648 }
2675 } 2649 }
2676 2650
2677 2651
2678 class _Uint16ArrayView extends _TypedListView implements Uint16List { 2652 class _Uint16ArrayView extends _TypedListView with _IntListMixin implements Uint 16List {
2679 // Constructor. 2653 // Constructor.
2680 _Uint16ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2654 _Uint16ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2681 : super(buffer, _offsetInBytes, 2655 : super(buffer, _offsetInBytes,
2682 _defaultIfNull(_length, 2656 _defaultIfNull(_length,
2683 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2657 ((buffer.lengthInBytes - _offsetInBytes) ~/
2684 Uint16List.BYTES_PER_ELEMENT))) { 2658 Uint16List.BYTES_PER_ELEMENT))) {
2685 _rangeCheck(buffer.lengthInBytes, 2659 _rangeCheck(buffer.lengthInBytes,
2686 offsetInBytes, 2660 offsetInBytes,
2687 length * Uint16List.BYTES_PER_ELEMENT); 2661 length * Uint16List.BYTES_PER_ELEMENT);
2688 _offsetAlignmentCheck(_offsetInBytes, Uint16List.BYTES_PER_ELEMENT); 2662 _offsetAlignmentCheck(_offsetInBytes, Uint16List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2700 } 2674 }
2701 2675
2702 void operator[]=(int index, int value) { 2676 void operator[]=(int index, int value) {
2703 if (index < 0 || index >= length) { 2677 if (index < 0 || index >= length) {
2704 _throwRangeError(index, length); 2678 _throwRangeError(index, length);
2705 } 2679 }
2706 _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT) , 2680 _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT) ,
2707 _toUint16(value)); 2681 _toUint16(value));
2708 } 2682 }
2709 2683
2710 Iterator<int> get iterator {
2711 return new _TypedListIterator<int>(this);
2712 }
2713
2714 2684
2715 // Method(s) implementing TypedData interface. 2685 // Method(s) implementing TypedData interface.
2716 2686
2717 int get elementSizeInBytes { 2687 int get elementSizeInBytes {
2718 return Uint16List.BYTES_PER_ELEMENT; 2688 return Uint16List.BYTES_PER_ELEMENT;
2719 } 2689 }
2720 2690
2721 2691
2722 // Internal utility methods. 2692 // Internal utility methods.
2723 2693
2724 Uint16List _createList(int length) { 2694 Uint16List _createList(int length) {
2725 return new Uint16List(length); 2695 return new Uint16List(length);
2726 } 2696 }
2727 } 2697 }
2728 2698
2729 2699
2730 class _Int32ArrayView extends _TypedListView implements Int32List { 2700 class _Int32ArrayView extends _TypedListView with _IntListMixin implements Int32 List {
2731 // Constructor. 2701 // Constructor.
2732 _Int32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2702 _Int32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2733 : super(buffer, _offsetInBytes, 2703 : super(buffer, _offsetInBytes,
2734 _defaultIfNull(_length, 2704 _defaultIfNull(_length,
2735 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2705 ((buffer.lengthInBytes - _offsetInBytes) ~/
2736 Int32List.BYTES_PER_ELEMENT))) { 2706 Int32List.BYTES_PER_ELEMENT))) {
2737 _rangeCheck(buffer.lengthInBytes, 2707 _rangeCheck(buffer.lengthInBytes,
2738 offsetInBytes, 2708 offsetInBytes,
2739 length * Int32List.BYTES_PER_ELEMENT); 2709 length * Int32List.BYTES_PER_ELEMENT);
2740 _offsetAlignmentCheck(_offsetInBytes, Int32List.BYTES_PER_ELEMENT); 2710 _offsetAlignmentCheck(_offsetInBytes, Int32List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2752 } 2722 }
2753 2723
2754 void operator[]=(int index, int value) { 2724 void operator[]=(int index, int value) {
2755 if (index < 0 || index >= length) { 2725 if (index < 0 || index >= length) {
2756 _throwRangeError(index, length); 2726 _throwRangeError(index, length);
2757 } 2727 }
2758 _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT), 2728 _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT),
2759 _toInt32(value)); 2729 _toInt32(value));
2760 } 2730 }
2761 2731
2762 Iterator<int> get iterator {
2763 return new _TypedListIterator<int>(this);
2764 }
2765
2766 2732
2767 // Method(s) implementing TypedData interface. 2733 // Method(s) implementing TypedData interface.
2768 2734
2769 int get elementSizeInBytes { 2735 int get elementSizeInBytes {
2770 return Int32List.BYTES_PER_ELEMENT; 2736 return Int32List.BYTES_PER_ELEMENT;
2771 } 2737 }
2772 2738
2773 2739
2774 // Internal utility methods. 2740 // Internal utility methods.
2775 2741
2776 Int32List _createList(int length) { 2742 Int32List _createList(int length) {
2777 return new Int32List(length); 2743 return new Int32List(length);
2778 } 2744 }
2779 } 2745 }
2780 2746
2781 2747
2782 class _Uint32ArrayView extends _TypedListView implements Uint32List { 2748 class _Uint32ArrayView extends _TypedListView with _IntListMixin implements Uint 32List {
2783 // Constructor. 2749 // Constructor.
2784 _Uint32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2750 _Uint32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2785 : super(buffer, _offsetInBytes, 2751 : super(buffer, _offsetInBytes,
2786 _defaultIfNull(_length, 2752 _defaultIfNull(_length,
2787 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2753 ((buffer.lengthInBytes - _offsetInBytes) ~/
2788 Uint32List.BYTES_PER_ELEMENT))) { 2754 Uint32List.BYTES_PER_ELEMENT))) {
2789 _rangeCheck(buffer.lengthInBytes, 2755 _rangeCheck(buffer.lengthInBytes,
2790 offsetInBytes, 2756 offsetInBytes,
2791 length * Uint32List.BYTES_PER_ELEMENT); 2757 length * Uint32List.BYTES_PER_ELEMENT);
2792 _offsetAlignmentCheck(_offsetInBytes, Uint32List.BYTES_PER_ELEMENT); 2758 _offsetAlignmentCheck(_offsetInBytes, Uint32List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2804 } 2770 }
2805 2771
2806 void operator[]=(int index, int value) { 2772 void operator[]=(int index, int value) {
2807 if (index < 0 || index >= length) { 2773 if (index < 0 || index >= length) {
2808 _throwRangeError(index, length); 2774 _throwRangeError(index, length);
2809 } 2775 }
2810 _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT) , 2776 _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT) ,
2811 _toUint32(value)); 2777 _toUint32(value));
2812 } 2778 }
2813 2779
2814 Iterator<int> get iterator {
2815 return new _TypedListIterator<int>(this);
2816 }
2817
2818 2780
2819 // Method(s) implementing TypedData interface. 2781 // Method(s) implementing TypedData interface.
2820 2782
2821 int get elementSizeInBytes { 2783 int get elementSizeInBytes {
2822 return Uint32List.BYTES_PER_ELEMENT; 2784 return Uint32List.BYTES_PER_ELEMENT;
2823 } 2785 }
2824 2786
2825 2787
2826 // Internal utility methods. 2788 // Internal utility methods.
2827 2789
2828 Uint32List _createList(int length) { 2790 Uint32List _createList(int length) {
2829 return new Uint32List(length); 2791 return new Uint32List(length);
2830 } 2792 }
2831 } 2793 }
2832 2794
2833 2795
2834 class _Int64ArrayView extends _TypedListView implements Int64List { 2796 class _Int64ArrayView extends _TypedListView with _IntListMixin implements Int64 List {
2835 // Constructor. 2797 // Constructor.
2836 _Int64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2798 _Int64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2837 : super(buffer, _offsetInBytes, 2799 : super(buffer, _offsetInBytes,
2838 _defaultIfNull(_length, 2800 _defaultIfNull(_length,
2839 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2801 ((buffer.lengthInBytes - _offsetInBytes) ~/
2840 Int64List.BYTES_PER_ELEMENT))) { 2802 Int64List.BYTES_PER_ELEMENT))) {
2841 _rangeCheck(buffer.lengthInBytes, 2803 _rangeCheck(buffer.lengthInBytes,
2842 offsetInBytes, 2804 offsetInBytes,
2843 length * Int64List.BYTES_PER_ELEMENT); 2805 length * Int64List.BYTES_PER_ELEMENT);
2844 _offsetAlignmentCheck(_offsetInBytes, Int64List.BYTES_PER_ELEMENT); 2806 _offsetAlignmentCheck(_offsetInBytes, Int64List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2856 } 2818 }
2857 2819
2858 void operator[]=(int index, int value) { 2820 void operator[]=(int index, int value) {
2859 if (index < 0 || index >= length) { 2821 if (index < 0 || index >= length) {
2860 _throwRangeError(index, length); 2822 _throwRangeError(index, length);
2861 } 2823 }
2862 _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT), 2824 _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT),
2863 _toInt64(value)); 2825 _toInt64(value));
2864 } 2826 }
2865 2827
2866 Iterator<int> get iterator {
2867 return new _TypedListIterator<int>(this);
2868 }
2869
2870 2828
2871 // Method(s) implementing TypedData interface. 2829 // Method(s) implementing TypedData interface.
2872 2830
2873 int get elementSizeInBytes { 2831 int get elementSizeInBytes {
2874 return Int64List.BYTES_PER_ELEMENT; 2832 return Int64List.BYTES_PER_ELEMENT;
2875 } 2833 }
2876 2834
2877 2835
2878 // Internal utility methods. 2836 // Internal utility methods.
2879 2837
2880 Int64List _createList(int length) { 2838 Int64List _createList(int length) {
2881 return new Int64List(length); 2839 return new Int64List(length);
2882 } 2840 }
2883 } 2841 }
2884 2842
2885 2843
2886 class _Uint64ArrayView extends _TypedListView implements Uint64List { 2844 class _Uint64ArrayView extends _TypedListView with _IntListMixin implements Uint 64List {
2887 // Constructor. 2845 // Constructor.
2888 _Uint64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2846 _Uint64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2889 : super(buffer, _offsetInBytes, 2847 : super(buffer, _offsetInBytes,
2890 _defaultIfNull(_length, 2848 _defaultIfNull(_length,
2891 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2849 ((buffer.lengthInBytes - _offsetInBytes) ~/
2892 Uint64List.BYTES_PER_ELEMENT))) { 2850 Uint64List.BYTES_PER_ELEMENT))) {
2893 _rangeCheck(buffer.lengthInBytes, 2851 _rangeCheck(buffer.lengthInBytes,
2894 offsetInBytes, 2852 offsetInBytes,
2895 length * Uint64List.BYTES_PER_ELEMENT); 2853 length * Uint64List.BYTES_PER_ELEMENT);
2896 _offsetAlignmentCheck(_offsetInBytes, Uint64List.BYTES_PER_ELEMENT); 2854 _offsetAlignmentCheck(_offsetInBytes, Uint64List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2908 } 2866 }
2909 2867
2910 void operator[]=(int index, int value) { 2868 void operator[]=(int index, int value) {
2911 if (index < 0 || index >= length) { 2869 if (index < 0 || index >= length) {
2912 _throwRangeError(index, length); 2870 _throwRangeError(index, length);
2913 } 2871 }
2914 _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT) , 2872 _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT) ,
2915 _toUint64(value)); 2873 _toUint64(value));
2916 } 2874 }
2917 2875
2918 Iterator<int> get iterator {
2919 return new _TypedListIterator<int>(this);
2920 }
2921
2922 2876
2923 // Method(s) implementing TypedData interface. 2877 // Method(s) implementing TypedData interface.
2924 2878
2925 int get elementSizeInBytes { 2879 int get elementSizeInBytes {
2926 return Uint64List.BYTES_PER_ELEMENT; 2880 return Uint64List.BYTES_PER_ELEMENT;
2927 } 2881 }
2928 2882
2929 2883
2930 // Internal utility methods. 2884 // Internal utility methods.
2931 2885
2932 Uint64List _createList(int length) { 2886 Uint64List _createList(int length) {
2933 return new Uint64List(length); 2887 return new Uint64List(length);
2934 } 2888 }
2935 } 2889 }
2936 2890
2937 2891
2938 class _Float32ArrayView extends _TypedListView implements Float32List { 2892 class _Float32ArrayView extends _TypedListView with _DoubleListMixin implements Float32List {
2939 // Constructor. 2893 // Constructor.
2940 _Float32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2894 _Float32ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2941 : super(buffer, _offsetInBytes, 2895 : super(buffer, _offsetInBytes,
2942 _defaultIfNull(_length, 2896 _defaultIfNull(_length,
2943 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2897 ((buffer.lengthInBytes - _offsetInBytes) ~/
2944 Float32List.BYTES_PER_ELEMENT))) { 2898 Float32List.BYTES_PER_ELEMENT))) {
2945 _rangeCheck(buffer.lengthInBytes, 2899 _rangeCheck(buffer.lengthInBytes,
2946 offsetInBytes, 2900 offsetInBytes,
2947 length * Float32List.BYTES_PER_ELEMENT); 2901 length * Float32List.BYTES_PER_ELEMENT);
2948 _offsetAlignmentCheck(_offsetInBytes, Float32List.BYTES_PER_ELEMENT); 2902 _offsetAlignmentCheck(_offsetInBytes, Float32List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
2960 } 2914 }
2961 2915
2962 void operator[]=(int index, double value) { 2916 void operator[]=(int index, double value) {
2963 if (index < 0 || index >= length) { 2917 if (index < 0 || index >= length) {
2964 _throwRangeError(index, length); 2918 _throwRangeError(index, length);
2965 } 2919 }
2966 _typedData._setFloat32(offsetInBytes + 2920 _typedData._setFloat32(offsetInBytes +
2967 (index * Float32List.BYTES_PER_ELEMENT), value); 2921 (index * Float32List.BYTES_PER_ELEMENT), value);
2968 } 2922 }
2969 2923
2970 Iterator<double> get iterator {
2971 return new _TypedListIterator<double>(this);
2972 }
2973
2974 2924
2975 // Method(s) implementing TypedData interface. 2925 // Method(s) implementing TypedData interface.
2976 2926
2977 int get elementSizeInBytes { 2927 int get elementSizeInBytes {
2978 return Float32List.BYTES_PER_ELEMENT; 2928 return Float32List.BYTES_PER_ELEMENT;
2979 } 2929 }
2980 2930
2981 2931
2982 // Internal utility methods. 2932 // Internal utility methods.
2983 2933
2984 Float32List _createList(int length) { 2934 Float32List _createList(int length) {
2985 return new Float32List(length); 2935 return new Float32List(length);
2986 } 2936 }
2987 } 2937 }
2988 2938
2989 2939
2990 class _Float64ArrayView extends _TypedListView implements Float64List { 2940 class _Float64ArrayView extends _TypedListView with _DoubleListMixin implements Float64List {
2991 // Constructor. 2941 // Constructor.
2992 _Float64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2942 _Float64ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
2993 : super(buffer, _offsetInBytes, 2943 : super(buffer, _offsetInBytes,
2994 _defaultIfNull(_length, 2944 _defaultIfNull(_length,
2995 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2945 ((buffer.lengthInBytes - _offsetInBytes) ~/
2996 Float64List.BYTES_PER_ELEMENT))) { 2946 Float64List.BYTES_PER_ELEMENT))) {
2997 _rangeCheck(buffer.lengthInBytes, 2947 _rangeCheck(buffer.lengthInBytes,
2998 offsetInBytes, 2948 offsetInBytes,
2999 length * Float64List.BYTES_PER_ELEMENT); 2949 length * Float64List.BYTES_PER_ELEMENT);
3000 _offsetAlignmentCheck(_offsetInBytes, Float64List.BYTES_PER_ELEMENT); 2950 _offsetAlignmentCheck(_offsetInBytes, Float64List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
3012 } 2962 }
3013 2963
3014 void operator[]=(int index, double value) { 2964 void operator[]=(int index, double value) {
3015 if (index < 0 || index >= length) { 2965 if (index < 0 || index >= length) {
3016 _throwRangeError(index, length); 2966 _throwRangeError(index, length);
3017 } 2967 }
3018 _typedData._setFloat64(offsetInBytes + 2968 _typedData._setFloat64(offsetInBytes +
3019 (index * Float64List.BYTES_PER_ELEMENT), value); 2969 (index * Float64List.BYTES_PER_ELEMENT), value);
3020 } 2970 }
3021 2971
3022 Iterator<double> get iterator {
3023 return new _TypedListIterator<double>(this);
3024 }
3025
3026 2972
3027 // Method(s) implementing TypedData interface. 2973 // Method(s) implementing TypedData interface.
3028 2974
3029 int get elementSizeInBytes { 2975 int get elementSizeInBytes {
3030 return Float64List.BYTES_PER_ELEMENT; 2976 return Float64List.BYTES_PER_ELEMENT;
3031 } 2977 }
3032 2978
3033 2979
3034 // Internal utility methods. 2980 // Internal utility methods.
3035 2981
3036 Float64List _createList(int length) { 2982 Float64List _createList(int length) {
3037 return new Float64List(length); 2983 return new Float64List(length);
3038 } 2984 }
3039 } 2985 }
3040 2986
3041 2987
3042 class _Float32x4ArrayView extends _TypedListView implements Float32x4List { 2988 class _Float32x4ArrayView extends _TypedListView with _Float32x4ListMixin implem ents Float32x4List {
3043 // Constructor. 2989 // Constructor.
3044 _Float32x4ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 2990 _Float32x4ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
3045 : super(buffer, _offsetInBytes, 2991 : super(buffer, _offsetInBytes,
3046 _defaultIfNull(_length, 2992 _defaultIfNull(_length,
3047 ((buffer.lengthInBytes - _offsetInBytes) ~/ 2993 ((buffer.lengthInBytes - _offsetInBytes) ~/
3048 Float32x4List.BYTES_PER_ELEMENT))) { 2994 Float32x4List.BYTES_PER_ELEMENT))) {
3049 _rangeCheck(buffer.lengthInBytes, 2995 _rangeCheck(buffer.lengthInBytes,
3050 offsetInBytes, 2996 offsetInBytes,
3051 length * Float32x4List.BYTES_PER_ELEMENT); 2997 length * Float32x4List.BYTES_PER_ELEMENT);
3052 _offsetAlignmentCheck(_offsetInBytes, Float32x4List.BYTES_PER_ELEMENT); 2998 _offsetAlignmentCheck(_offsetInBytes, Float32x4List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
3064 } 3010 }
3065 3011
3066 void operator[]=(int index, Float32x4 value) { 3012 void operator[]=(int index, Float32x4 value) {
3067 if (index < 0 || index >= length) { 3013 if (index < 0 || index >= length) {
3068 _throwRangeError(index, length); 3014 _throwRangeError(index, length);
3069 } 3015 }
3070 _typedData._setFloat32x4(offsetInBytes + 3016 _typedData._setFloat32x4(offsetInBytes +
3071 (index * Float32x4List.BYTES_PER_ELEMENT), value); 3017 (index * Float32x4List.BYTES_PER_ELEMENT), value);
3072 } 3018 }
3073 3019
3074 Iterator<Float32x4> get iterator {
3075 return new _TypedListIterator<Float32x4>(this);
3076 }
3077
3078 3020
3079 // Method(s) implementing TypedData interface. 3021 // Method(s) implementing TypedData interface.
3080 3022
3081 int get elementSizeInBytes { 3023 int get elementSizeInBytes {
3082 return Float32x4List.BYTES_PER_ELEMENT; 3024 return Float32x4List.BYTES_PER_ELEMENT;
3083 } 3025 }
3084 3026
3085 3027
3086 // Internal utility methods. 3028 // Internal utility methods.
3087 3029
3088 Float32x4List _createList(int length) { 3030 Float32x4List _createList(int length) {
3089 return new Float32x4List(length); 3031 return new Float32x4List(length);
3090 } 3032 }
3091 } 3033 }
3092 3034
3093 3035
3094 class _Int32x4ArrayView extends _TypedListView implements Int32x4List { 3036 class _Int32x4ArrayView extends _TypedListView with _Int32x4ListMixin implements Int32x4List {
3095 // Constructor. 3037 // Constructor.
3096 _Int32x4ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 3038 _Int32x4ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
3097 : super(buffer, _offsetInBytes, 3039 : super(buffer, _offsetInBytes,
3098 _defaultIfNull(_length, 3040 _defaultIfNull(_length,
3099 ((buffer.lengthInBytes - _offsetInBytes) ~/ 3041 ((buffer.lengthInBytes - _offsetInBytes) ~/
3100 Int32x4List.BYTES_PER_ELEMENT))) { 3042 Int32x4List.BYTES_PER_ELEMENT))) {
3101 _rangeCheck(buffer.lengthInBytes, 3043 _rangeCheck(buffer.lengthInBytes,
3102 offsetInBytes, 3044 offsetInBytes,
3103 length * Int32x4List.BYTES_PER_ELEMENT); 3045 length * Int32x4List.BYTES_PER_ELEMENT);
3104 _offsetAlignmentCheck(_offsetInBytes, Int32x4List.BYTES_PER_ELEMENT); 3046 _offsetAlignmentCheck(_offsetInBytes, Int32x4List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
3116 } 3058 }
3117 3059
3118 void operator[]=(int index, Int32x4 value) { 3060 void operator[]=(int index, Int32x4 value) {
3119 if (index < 0 || index >= length) { 3061 if (index < 0 || index >= length) {
3120 _throwRangeError(index, length); 3062 _throwRangeError(index, length);
3121 } 3063 }
3122 _typedData._setInt32x4(offsetInBytes + 3064 _typedData._setInt32x4(offsetInBytes +
3123 (index * Int32x4List.BYTES_PER_ELEMENT), value); 3065 (index * Int32x4List.BYTES_PER_ELEMENT), value);
3124 } 3066 }
3125 3067
3126 Iterator<Int32x4> get iterator {
3127 return new _TypedListIterator<Int32x4>(this);
3128 }
3129
3130 3068
3131 // Method(s) implementing TypedData interface. 3069 // Method(s) implementing TypedData interface.
3132 3070
3133 int get elementSizeInBytes { 3071 int get elementSizeInBytes {
3134 return Int32x4List.BYTES_PER_ELEMENT; 3072 return Int32x4List.BYTES_PER_ELEMENT;
3135 } 3073 }
3136 3074
3137 3075
3138 // Internal utility methods. 3076 // Internal utility methods.
3139 3077
3140 Int32x4List _createList(int length) { 3078 Int32x4List _createList(int length) {
3141 return new Int32x4List(length); 3079 return new Int32x4List(length);
3142 } 3080 }
3143 } 3081 }
3144 3082
3145 3083
3146 class _Float64x2ArrayView extends _TypedListView implements Float64x2List { 3084 class _Float64x2ArrayView extends _TypedListView with _Float64x2ListMixin implem ents Float64x2List {
3147 // Constructor. 3085 // Constructor.
3148 _Float64x2ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length]) 3086 _Float64x2ArrayView(ByteBuffer buffer, [int _offsetInBytes = 0, int _length])
3149 : super(buffer, _offsetInBytes, 3087 : super(buffer, _offsetInBytes,
3150 _defaultIfNull(_length, 3088 _defaultIfNull(_length,
3151 ((buffer.lengthInBytes - _offsetInBytes) ~/ 3089 ((buffer.lengthInBytes - _offsetInBytes) ~/
3152 Float64x2List.BYTES_PER_ELEMENT))) { 3090 Float64x2List.BYTES_PER_ELEMENT))) {
3153 _rangeCheck(buffer.lengthInBytes, 3091 _rangeCheck(buffer.lengthInBytes,
3154 offsetInBytes, 3092 offsetInBytes,
3155 length * Float64x2List.BYTES_PER_ELEMENT); 3093 length * Float64x2List.BYTES_PER_ELEMENT);
3156 _offsetAlignmentCheck(_offsetInBytes, Float64x2List.BYTES_PER_ELEMENT); 3094 _offsetAlignmentCheck(_offsetInBytes, Float64x2List.BYTES_PER_ELEMENT);
(...skipping 11 matching lines...) Expand all
3168 } 3106 }
3169 3107
3170 void operator[]=(int index, Float64x2 value) { 3108 void operator[]=(int index, Float64x2 value) {
3171 if (index < 0 || index >= length) { 3109 if (index < 0 || index >= length) {
3172 _throwRangeError(index, length); 3110 _throwRangeError(index, length);
3173 } 3111 }
3174 _typedData._setFloat64x2(offsetInBytes + 3112 _typedData._setFloat64x2(offsetInBytes +
3175 (index * Float64x2List.BYTES_PER_ELEMENT), value); 3113 (index * Float64x2List.BYTES_PER_ELEMENT), value);
3176 } 3114 }
3177 3115
3178 Iterator<Float64x2> get iterator {
3179 return new _TypedListIterator<Float64x2>(this);
3180 }
3181
3182 3116
3183 // Method(s) implementing TypedData interface. 3117 // Method(s) implementing TypedData interface.
3184 3118
3185 int get elementSizeInBytes { 3119 int get elementSizeInBytes {
3186 return Float64x2List.BYTES_PER_ELEMENT; 3120 return Float64x2List.BYTES_PER_ELEMENT;
3187 } 3121 }
3188 3122
3189 3123
3190 // Internal utility methods. 3124 // Internal utility methods.
3191 3125
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
3563 return value; 3497 return value;
3564 } 3498 }
3565 return object; 3499 return object;
3566 } 3500 }
3567 3501
3568 3502
3569 void _throwRangeError(int index, int length) { 3503 void _throwRangeError(int index, int length) {
3570 String message = "$index must be in the range [0..$length)"; 3504 String message = "$index must be in the range [0..$length)";
3571 throw new RangeError(message); 3505 throw new RangeError(message);
3572 } 3506 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698