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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void clear() { | 199 void clear() { |
200 throw new UnsupportedError( | 200 throw new UnsupportedError( |
201 "Cannot remove from a non-extendable array"); | 201 "Cannot remove from a non-extendable array"); |
202 } | 202 } |
203 | 203 |
204 int removeLast() { | 204 int removeLast() { |
205 throw new UnsupportedError( | 205 throw new UnsupportedError( |
206 "Cannot remove from a non-extendable array"); | 206 "Cannot remove from a non-extendable array"); |
207 } | 207 } |
208 | 208 |
209 get first { | |
210 return this[0]; | |
211 } | |
212 | |
213 get last { | 209 get last { |
214 return this[length - 1]; | 210 return this[length - 1]; |
215 } | 211 } |
216 | 212 |
217 void removeRange(int start, int length) { | 213 void removeRange(int start, int length) { |
218 throw new UnsupportedError( | 214 throw new UnsupportedError( |
219 "Cannot remove from a non-extendable array"); | 215 "Cannot remove from a non-extendable array"); |
220 } | 216 } |
221 | 217 |
222 void insertRange(int start, int length, [initialValue]) { | 218 void insertRange(int start, int length, [initialValue]) { |
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 void clear() { | 1677 void clear() { |
1682 throw new UnsupportedError( | 1678 throw new UnsupportedError( |
1683 "Cannot remove from a non-extendable array"); | 1679 "Cannot remove from a non-extendable array"); |
1684 } | 1680 } |
1685 | 1681 |
1686 int removeLast() { | 1682 int removeLast() { |
1687 throw new UnsupportedError( | 1683 throw new UnsupportedError( |
1688 "Cannot remove from a non-extendable array"); | 1684 "Cannot remove from a non-extendable array"); |
1689 } | 1685 } |
1690 | 1686 |
1691 get first { | |
1692 return this[0]; | |
1693 } | |
1694 | |
1695 get last { | 1687 get last { |
1696 return this[length - 1]; | 1688 return this[length - 1]; |
1697 } | 1689 } |
1698 | 1690 |
1699 void removeRange(int start, int length) { | 1691 void removeRange(int start, int length) { |
1700 throw new UnsupportedError( | 1692 throw new UnsupportedError( |
1701 "Cannot remove from a non-extendable array"); | 1693 "Cannot remove from a non-extendable array"); |
1702 } | 1694 } |
1703 | 1695 |
1704 void insertRange(int start, int length, [initialValue]) { | 1696 void insertRange(int start, int length, [initialValue]) { |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2419 } | 2411 } |
2420 _rangeCheck(this.length, start, length); | 2412 _rangeCheck(this.length, start, length); |
2421 return _array.subByteArray(_offset + start, length); | 2413 return _array.subByteArray(_offset + start, length); |
2422 } | 2414 } |
2423 | 2415 |
2424 static const int _BYTES_PER_ELEMENT = 8; | 2416 static const int _BYTES_PER_ELEMENT = 8; |
2425 final ByteArray _array; | 2417 final ByteArray _array; |
2426 final int _offset; | 2418 final int _offset; |
2427 final int _length; | 2419 final int _length; |
2428 } | 2420 } |
OLD | NEW |