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.transferable(int length) { | 10 /* patch */ factory Int8List.transferable(int length) { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 if (length > 0) return this[length - 1]; | 316 if (length > 0) return this[length - 1]; |
317 throw new StateError("No elements"); | 317 throw new StateError("No elements"); |
318 } | 318 } |
319 | 319 |
320 int get single { | 320 int get single { |
321 if (length == 1) return this[0]; | 321 if (length == 1) return this[0]; |
322 if (length == 0) throw new StateError("No elements"); | 322 if (length == 0) throw new StateError("No elements"); |
323 throw new StateError("More than one element"); | 323 throw new StateError("More than one element"); |
324 } | 324 } |
325 | 325 |
326 int min([int compare(int a, int b)]) => Collections.min(this, compare); | |
Anders Johnsen
2013/01/02 11:04:05
As far as I remember, Float32List extends this obj
Lasse Reichstein Nielsen
2013/01/02 11:49:33
You are right. The getters above, and several othe
| |
327 | |
328 int max([int compare(int a, int b)]) => Collections.max(this, compare); | |
329 | |
326 void removeRange(int start, int length) { | 330 void removeRange(int start, int length) { |
327 throw new UnsupportedError( | 331 throw new UnsupportedError( |
328 "Cannot remove from a non-extendable array"); | 332 "Cannot remove from a non-extendable array"); |
329 } | 333 } |
330 | 334 |
331 void insertRange(int start, int length, [initialValue]) { | 335 void insertRange(int start, int length, [initialValue]) { |
332 throw new UnsupportedError( | 336 throw new UnsupportedError( |
333 "Cannot add to a non-extendable array"); | 337 "Cannot add to a non-extendable array"); |
334 } | 338 } |
335 | 339 |
(...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2669 } | 2673 } |
2670 _rangeCheck(this.length, start, length); | 2674 _rangeCheck(this.length, start, length); |
2671 return _array.subByteArray(_offset + start, length); | 2675 return _array.subByteArray(_offset + start, length); |
2672 } | 2676 } |
2673 | 2677 |
2674 static const int _BYTES_PER_ELEMENT = 8; | 2678 static const int _BYTES_PER_ELEMENT = 8; |
2675 final ByteArray _array; | 2679 final ByteArray _array; |
2676 final int _offset; | 2680 final int _offset; |
2677 final int _length; | 2681 final int _length; |
2678 } | 2682 } |
OLD | NEW |