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