OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 patch class Int8List { | 5 patch class Int8List { |
6 /* patch */ factory Int8List(int length) { | 6 /* patch */ factory Int8List(int length) { |
7 return new _Int8Array(length); | 7 return new _Int8Array(length); |
8 } | 8 } |
9 | 9 |
10 /* patch */ factory Int8List.view(ByteArray array, | 10 /* patch */ factory Int8List.view(ByteArray array, |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 int _toInt64(int value) { | 301 int _toInt64(int value) { |
302 return _toInt(value, 0xFFFFFFFFFFFFFFFF); | 302 return _toInt(value, 0xFFFFFFFFFFFFFFFF); |
303 } | 303 } |
304 int _toUint64(int value) { | 304 int _toUint64(int value) { |
305 return value & 0xFFFFFFFFFFFFFFFF; | 305 return value & 0xFFFFFFFFFFFFFFFF; |
306 } | 306 } |
307 | 307 |
308 | 308 |
309 void _rangeCheck(int listLength, int start, int length) { | 309 void _rangeCheck(int listLength, int start, int length) { |
310 if (length < 0) { | 310 if (length < 0) { |
311 throw new IndexOutOfRangeException(length); | 311 throw new RangeError.value(length); |
312 } | 312 } |
313 if (start < 0) { | 313 if (start < 0) { |
314 throw new IndexOutOfRangeException(start); | 314 throw new RangeError.value(start); |
315 } | 315 } |
316 if (start + length > listLength) { | 316 if (start + length > listLength) { |
317 throw new IndexOutOfRangeException(start + length); | 317 throw new RangeError.value(start + length); |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 | 321 |
322 int _requireInteger(object) { | 322 int _requireInteger(object) { |
323 if (object is int) { | 323 if (object is int) { |
324 return object; | 324 return object; |
325 } | 325 } |
326 throw new ArgumentError("$object is not an integer"); | 326 throw new ArgumentError("$object is not an integer"); |
327 } | 327 } |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 1710 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
1711 } | 1711 } |
1712 | 1712 |
1713 get length { | 1713 get length { |
1714 return _length; | 1714 return _length; |
1715 } | 1715 } |
1716 | 1716 |
1717 int operator[](int index) { | 1717 int operator[](int index) { |
1718 if (index < 0 || index >= _length) { | 1718 if (index < 0 || index >= _length) { |
1719 String message = "$index must be in the range [0..$_length)"; | 1719 String message = "$index must be in the range [0..$_length)"; |
1720 throw new IndexOutOfRangeException(message); | 1720 throw new RangeError(message); |
1721 } | 1721 } |
1722 return _array.getInt8(_offset + (index * _BYTES_PER_ELEMENT)); | 1722 return _array.getInt8(_offset + (index * _BYTES_PER_ELEMENT)); |
1723 } | 1723 } |
1724 | 1724 |
1725 void operator[]=(int index, int value) { | 1725 void operator[]=(int index, int value) { |
1726 if (index < 0 || index >= _length) { | 1726 if (index < 0 || index >= _length) { |
1727 String message = "$index must be in the range [0..$_length)"; | 1727 String message = "$index must be in the range [0..$_length)"; |
1728 throw new IndexOutOfRangeException(message); | 1728 throw new RangeError(message); |
1729 } | 1729 } |
1730 _array.setInt8(_offset + (index * _BYTES_PER_ELEMENT), _toInt8(value)); | 1730 _array.setInt8(_offset + (index * _BYTES_PER_ELEMENT), _toInt8(value)); |
1731 } | 1731 } |
1732 | 1732 |
1733 Iterator<int> iterator() { | 1733 Iterator<int> iterator() { |
1734 return new _ByteArrayIterator<int>(this); | 1734 return new _ByteArrayIterator<int>(this); |
1735 } | 1735 } |
1736 | 1736 |
1737 List<int> getRange(int start, int length) { | 1737 List<int> getRange(int start, int length) { |
1738 _rangeCheck(this.length, start, length); | 1738 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1782 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 1782 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
1783 } | 1783 } |
1784 | 1784 |
1785 get length { | 1785 get length { |
1786 return _length; | 1786 return _length; |
1787 } | 1787 } |
1788 | 1788 |
1789 int operator[](int index) { | 1789 int operator[](int index) { |
1790 if (index < 0 || index >= _length) { | 1790 if (index < 0 || index >= _length) { |
1791 String message = "$index must be in the range [0..$_length)"; | 1791 String message = "$index must be in the range [0..$_length)"; |
1792 throw new IndexOutOfRangeException(message); | 1792 throw new RangeError(message); |
1793 } | 1793 } |
1794 return _array.getUint8(_offset + (index * _BYTES_PER_ELEMENT)); | 1794 return _array.getUint8(_offset + (index * _BYTES_PER_ELEMENT)); |
1795 } | 1795 } |
1796 | 1796 |
1797 void operator[]=(int index, int value) { | 1797 void operator[]=(int index, int value) { |
1798 if (index < 0 || index >= _length) { | 1798 if (index < 0 || index >= _length) { |
1799 String message = "$index must be in the range [0..$_length)"; | 1799 String message = "$index must be in the range [0..$_length)"; |
1800 throw new IndexOutOfRangeException(message); | 1800 throw new RangeError(message); |
1801 } | 1801 } |
1802 _array.setUint8(_offset + (index * _BYTES_PER_ELEMENT), _toUint8(value)); | 1802 _array.setUint8(_offset + (index * _BYTES_PER_ELEMENT), _toUint8(value)); |
1803 } | 1803 } |
1804 | 1804 |
1805 Iterator<int> iterator() { | 1805 Iterator<int> iterator() { |
1806 return new _ByteArrayIterator<int>(this); | 1806 return new _ByteArrayIterator<int>(this); |
1807 } | 1807 } |
1808 | 1808 |
1809 List<int> getRange(int start, int length) { | 1809 List<int> getRange(int start, int length) { |
1810 _rangeCheck(this.length, start, length); | 1810 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 1854 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
1855 } | 1855 } |
1856 | 1856 |
1857 get length { | 1857 get length { |
1858 return _length; | 1858 return _length; |
1859 } | 1859 } |
1860 | 1860 |
1861 int operator[](int index) { | 1861 int operator[](int index) { |
1862 if (index < 0 || index >= _length) { | 1862 if (index < 0 || index >= _length) { |
1863 String message = "$index must be in the range [0..$_length)"; | 1863 String message = "$index must be in the range [0..$_length)"; |
1864 throw new IndexOutOfRangeException(message); | 1864 throw new RangeError(message); |
1865 } | 1865 } |
1866 return _array.getInt16(_offset + (index * _BYTES_PER_ELEMENT)); | 1866 return _array.getInt16(_offset + (index * _BYTES_PER_ELEMENT)); |
1867 } | 1867 } |
1868 | 1868 |
1869 void operator[]=(int index, int value) { | 1869 void operator[]=(int index, int value) { |
1870 if (index < 0 || index >= _length) { | 1870 if (index < 0 || index >= _length) { |
1871 String message = "$index must be in the range [0..$_length)"; | 1871 String message = "$index must be in the range [0..$_length)"; |
1872 throw new IndexOutOfRangeException(message); | 1872 throw new RangeError(message); |
1873 } | 1873 } |
1874 _array.setInt16(_offset + (index * _BYTES_PER_ELEMENT), _toInt16(value)); | 1874 _array.setInt16(_offset + (index * _BYTES_PER_ELEMENT), _toInt16(value)); |
1875 } | 1875 } |
1876 | 1876 |
1877 Iterator<int> iterator() { | 1877 Iterator<int> iterator() { |
1878 return new _ByteArrayIterator<int>(this); | 1878 return new _ByteArrayIterator<int>(this); |
1879 } | 1879 } |
1880 | 1880 |
1881 List<int> getRange(int start, int length) { | 1881 List<int> getRange(int start, int length) { |
1882 _rangeCheck(this.length, start, length); | 1882 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 1926 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
1927 } | 1927 } |
1928 | 1928 |
1929 get length { | 1929 get length { |
1930 return _length; | 1930 return _length; |
1931 } | 1931 } |
1932 | 1932 |
1933 int operator[](int index) { | 1933 int operator[](int index) { |
1934 if (index < 0 || index >= _length) { | 1934 if (index < 0 || index >= _length) { |
1935 String message = "$index must be in the range [0..$_length)"; | 1935 String message = "$index must be in the range [0..$_length)"; |
1936 throw new IndexOutOfRangeException(message); | 1936 throw new RangeError(message); |
1937 } | 1937 } |
1938 return _array.getUint16(_offset + (index * _BYTES_PER_ELEMENT)); | 1938 return _array.getUint16(_offset + (index * _BYTES_PER_ELEMENT)); |
1939 } | 1939 } |
1940 | 1940 |
1941 void operator[]=(int index, int value) { | 1941 void operator[]=(int index, int value) { |
1942 if (index < 0 || index >= _length) { | 1942 if (index < 0 || index >= _length) { |
1943 String message = "$index must be in the range [0..$_length)"; | 1943 String message = "$index must be in the range [0..$_length)"; |
1944 throw new IndexOutOfRangeException(message); | 1944 throw new RangeError(message); |
1945 } | 1945 } |
1946 _array.setUint16(_offset + (index * _BYTES_PER_ELEMENT), _toUint16(value)); | 1946 _array.setUint16(_offset + (index * _BYTES_PER_ELEMENT), _toUint16(value)); |
1947 } | 1947 } |
1948 | 1948 |
1949 Iterator<int> iterator() { | 1949 Iterator<int> iterator() { |
1950 return new _ByteArrayIterator<int>(this); | 1950 return new _ByteArrayIterator<int>(this); |
1951 } | 1951 } |
1952 | 1952 |
1953 List<int> getRange(int start, int length) { | 1953 List<int> getRange(int start, int length) { |
1954 _rangeCheck(this.length, start, length); | 1954 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 1998 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
1999 } | 1999 } |
2000 | 2000 |
2001 get length { | 2001 get length { |
2002 return _length; | 2002 return _length; |
2003 } | 2003 } |
2004 | 2004 |
2005 int operator[](int index) { | 2005 int operator[](int index) { |
2006 if (index < 0 || index >= _length) { | 2006 if (index < 0 || index >= _length) { |
2007 String message = "$index must be in the range [0..$_length)"; | 2007 String message = "$index must be in the range [0..$_length)"; |
2008 throw new IndexOutOfRangeException(message); | 2008 throw new RangeError(message); |
2009 } | 2009 } |
2010 return _array.getInt32(_offset + (index * _BYTES_PER_ELEMENT)); | 2010 return _array.getInt32(_offset + (index * _BYTES_PER_ELEMENT)); |
2011 } | 2011 } |
2012 | 2012 |
2013 void operator[]=(int index, int value) { | 2013 void operator[]=(int index, int value) { |
2014 if (index < 0 || index >= _length) { | 2014 if (index < 0 || index >= _length) { |
2015 String message = "$index must be in the range [0..$_length)"; | 2015 String message = "$index must be in the range [0..$_length)"; |
2016 throw new IndexOutOfRangeException(message); | 2016 throw new RangeError(message); |
2017 } | 2017 } |
2018 _array.setInt32(_offset + (index * _BYTES_PER_ELEMENT), _toInt32(value)); | 2018 _array.setInt32(_offset + (index * _BYTES_PER_ELEMENT), _toInt32(value)); |
2019 } | 2019 } |
2020 | 2020 |
2021 Iterator<int> iterator() { | 2021 Iterator<int> iterator() { |
2022 return new _ByteArrayIterator<int>(this); | 2022 return new _ByteArrayIterator<int>(this); |
2023 } | 2023 } |
2024 | 2024 |
2025 List<int> getRange(int start, int length) { | 2025 List<int> getRange(int start, int length) { |
2026 _rangeCheck(this.length, start, length); | 2026 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 2070 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
2071 } | 2071 } |
2072 | 2072 |
2073 get length { | 2073 get length { |
2074 return _length; | 2074 return _length; |
2075 } | 2075 } |
2076 | 2076 |
2077 int operator[](int index) { | 2077 int operator[](int index) { |
2078 if (index < 0 || index >= _length) { | 2078 if (index < 0 || index >= _length) { |
2079 String message = "$index must be in the range [0..$_length)"; | 2079 String message = "$index must be in the range [0..$_length)"; |
2080 throw new IndexOutOfRangeException(message); | 2080 throw new RangeError(message); |
2081 } | 2081 } |
2082 return _array.getUint32(_offset + (index * _BYTES_PER_ELEMENT)); | 2082 return _array.getUint32(_offset + (index * _BYTES_PER_ELEMENT)); |
2083 } | 2083 } |
2084 | 2084 |
2085 void operator[]=(int index, int value) { | 2085 void operator[]=(int index, int value) { |
2086 if (index < 0 || index >= _length) { | 2086 if (index < 0 || index >= _length) { |
2087 String message = "$index must be in the range [0..$_length)"; | 2087 String message = "$index must be in the range [0..$_length)"; |
2088 throw new IndexOutOfRangeException(message); | 2088 throw new RangeError(message); |
2089 } | 2089 } |
2090 _array.setUint32(_offset + (index * _BYTES_PER_ELEMENT), _toUint32(value)); | 2090 _array.setUint32(_offset + (index * _BYTES_PER_ELEMENT), _toUint32(value)); |
2091 } | 2091 } |
2092 | 2092 |
2093 Iterator<int> iterator() { | 2093 Iterator<int> iterator() { |
2094 return new _ByteArrayIterator<int>(this); | 2094 return new _ByteArrayIterator<int>(this); |
2095 } | 2095 } |
2096 | 2096 |
2097 List<int> getRange(int start, int length) { | 2097 List<int> getRange(int start, int length) { |
2098 _rangeCheck(this.length, start, length); | 2098 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 2142 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
2143 } | 2143 } |
2144 | 2144 |
2145 get length { | 2145 get length { |
2146 return _length; | 2146 return _length; |
2147 } | 2147 } |
2148 | 2148 |
2149 int operator[](int index) { | 2149 int operator[](int index) { |
2150 if (index < 0 || index >= _length) { | 2150 if (index < 0 || index >= _length) { |
2151 String message = "$index must be in the range [0..$_length)"; | 2151 String message = "$index must be in the range [0..$_length)"; |
2152 throw new IndexOutOfRangeException(message); | 2152 throw new RangeError(message); |
2153 } | 2153 } |
2154 return _array.getInt64(_offset + (index * _BYTES_PER_ELEMENT)); | 2154 return _array.getInt64(_offset + (index * _BYTES_PER_ELEMENT)); |
2155 } | 2155 } |
2156 | 2156 |
2157 void operator[]=(int index, int value) { | 2157 void operator[]=(int index, int value) { |
2158 if (index < 0 || index >= _length) { | 2158 if (index < 0 || index >= _length) { |
2159 String message = "$index must be in the range [0..$_length)"; | 2159 String message = "$index must be in the range [0..$_length)"; |
2160 throw new IndexOutOfRangeException(message); | 2160 throw new RangeError(message); |
2161 } | 2161 } |
2162 _array.setInt64(_offset + (index * _BYTES_PER_ELEMENT), _toInt64(value)); | 2162 _array.setInt64(_offset + (index * _BYTES_PER_ELEMENT), _toInt64(value)); |
2163 } | 2163 } |
2164 | 2164 |
2165 Iterator<int> iterator() { | 2165 Iterator<int> iterator() { |
2166 return new _ByteArrayIterator<int>(this); | 2166 return new _ByteArrayIterator<int>(this); |
2167 } | 2167 } |
2168 | 2168 |
2169 List<int> getRange(int start, int length) { | 2169 List<int> getRange(int start, int length) { |
2170 _rangeCheck(this.length, start, length); | 2170 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2214 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 2214 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
2215 } | 2215 } |
2216 | 2216 |
2217 get length { | 2217 get length { |
2218 return _length; | 2218 return _length; |
2219 } | 2219 } |
2220 | 2220 |
2221 int operator[](int index) { | 2221 int operator[](int index) { |
2222 if (index < 0 || index >= _length) { | 2222 if (index < 0 || index >= _length) { |
2223 String message = "$index must be in the range [0..$_length)"; | 2223 String message = "$index must be in the range [0..$_length)"; |
2224 throw new IndexOutOfRangeException(message); | 2224 throw new RangeError(message); |
2225 } | 2225 } |
2226 return _array.getUint64(_offset + (index * _BYTES_PER_ELEMENT)); | 2226 return _array.getUint64(_offset + (index * _BYTES_PER_ELEMENT)); |
2227 } | 2227 } |
2228 | 2228 |
2229 void operator[]=(int index, int value) { | 2229 void operator[]=(int index, int value) { |
2230 if (index < 0 || index >= _length) { | 2230 if (index < 0 || index >= _length) { |
2231 String message = "$index must be in the range [0..$_length)"; | 2231 String message = "$index must be in the range [0..$_length)"; |
2232 throw new IndexOutOfRangeException(message); | 2232 throw new RangeError(message); |
2233 } | 2233 } |
2234 _array.setUint64(_offset + (index * _BYTES_PER_ELEMENT), _toUint64(value)); | 2234 _array.setUint64(_offset + (index * _BYTES_PER_ELEMENT), _toUint64(value)); |
2235 } | 2235 } |
2236 | 2236 |
2237 Iterator<int> iterator() { | 2237 Iterator<int> iterator() { |
2238 return new _ByteArrayIterator<int>(this); | 2238 return new _ByteArrayIterator<int>(this); |
2239 } | 2239 } |
2240 | 2240 |
2241 List<int> getRange(int start, int length) { | 2241 List<int> getRange(int start, int length) { |
2242 _rangeCheck(this.length, start, length); | 2242 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2286 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 2286 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
2287 } | 2287 } |
2288 | 2288 |
2289 get length { | 2289 get length { |
2290 return _length; | 2290 return _length; |
2291 } | 2291 } |
2292 | 2292 |
2293 double operator[](int index) { | 2293 double operator[](int index) { |
2294 if (index < 0 || index >= _length) { | 2294 if (index < 0 || index >= _length) { |
2295 String message = "$index must be in the range [0..$_length)"; | 2295 String message = "$index must be in the range [0..$_length)"; |
2296 throw new IndexOutOfRangeException(message); | 2296 throw new RangeError(message); |
2297 } | 2297 } |
2298 return _array.getFloat32(_offset + (index * _BYTES_PER_ELEMENT)); | 2298 return _array.getFloat32(_offset + (index * _BYTES_PER_ELEMENT)); |
2299 } | 2299 } |
2300 | 2300 |
2301 void operator[]=(int index, double value) { | 2301 void operator[]=(int index, double value) { |
2302 if (index < 0 || index >= _length) { | 2302 if (index < 0 || index >= _length) { |
2303 String message = "$index must be in the range [0..$_length)"; | 2303 String message = "$index must be in the range [0..$_length)"; |
2304 throw new IndexOutOfRangeException(message); | 2304 throw new RangeError(message); |
2305 } | 2305 } |
2306 _array.setFloat32(_offset + (index * _BYTES_PER_ELEMENT), value); | 2306 _array.setFloat32(_offset + (index * _BYTES_PER_ELEMENT), value); |
2307 } | 2307 } |
2308 | 2308 |
2309 Iterator<double> iterator() { | 2309 Iterator<double> iterator() { |
2310 return new _ByteArrayIterator<double>(this); | 2310 return new _ByteArrayIterator<double>(this); |
2311 } | 2311 } |
2312 | 2312 |
2313 List<double> getRange(int start, int length) { | 2313 List<double> getRange(int start, int length) { |
2314 _rangeCheck(this.length, start, length); | 2314 _rangeCheck(this.length, start, length); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); | 2358 _rangeCheck(array.lengthInBytes(), _offset, _length * _BYTES_PER_ELEMENT); |
2359 } | 2359 } |
2360 | 2360 |
2361 get length { | 2361 get length { |
2362 return _length; | 2362 return _length; |
2363 } | 2363 } |
2364 | 2364 |
2365 double operator[](int index) { | 2365 double operator[](int index) { |
2366 if (index < 0 || index >= _length) { | 2366 if (index < 0 || index >= _length) { |
2367 String message = "$index must be in the range [0..$_length)"; | 2367 String message = "$index must be in the range [0..$_length)"; |
2368 throw new IndexOutOfRangeException(message); | 2368 throw new RangeError(message); |
2369 } | 2369 } |
2370 return _array.getFloat64(_offset + (index * _BYTES_PER_ELEMENT)); | 2370 return _array.getFloat64(_offset + (index * _BYTES_PER_ELEMENT)); |
2371 } | 2371 } |
2372 | 2372 |
2373 void operator[]=(int index, double value) { | 2373 void operator[]=(int index, double value) { |
2374 if (index < 0 || index >= _length) { | 2374 if (index < 0 || index >= _length) { |
2375 String message = "$index must be in the range [0..$_length)"; | 2375 String message = "$index must be in the range [0..$_length)"; |
2376 throw new IndexOutOfRangeException(message); | 2376 throw new RangeError(message); |
2377 } | 2377 } |
2378 _array.setFloat64(_offset + (index * _BYTES_PER_ELEMENT), value); | 2378 _array.setFloat64(_offset + (index * _BYTES_PER_ELEMENT), value); |
2379 } | 2379 } |
2380 | 2380 |
2381 Iterator<double> iterator() { | 2381 Iterator<double> iterator() { |
2382 return new _ByteArrayIterator<double>(this); | 2382 return new _ByteArrayIterator<double>(this); |
2383 } | 2383 } |
2384 | 2384 |
2385 List<double> getRange(int start, int length) { | 2385 List<double> getRange(int start, int length) { |
2386 _rangeCheck(this.length, start, length); | 2386 _rangeCheck(this.length, start, length); |
(...skipping 24 matching lines...) Expand all Loading... |
2411 } | 2411 } |
2412 _rangeCheck(this.length, start, length); | 2412 _rangeCheck(this.length, start, length); |
2413 return _array.subByteArray(_offset + start, length); | 2413 return _array.subByteArray(_offset + start, length); |
2414 } | 2414 } |
2415 | 2415 |
2416 static const int _BYTES_PER_ELEMENT = 8; | 2416 static const int _BYTES_PER_ELEMENT = 8; |
2417 final ByteArray _array; | 2417 final ByteArray _array; |
2418 final int _offset; | 2418 final int _offset; |
2419 final int _length; | 2419 final int _length; |
2420 } | 2420 } |
OLD | NEW |