Chromium Code Reviews| Index: sdk/lib/typeddata/dartium/typeddata_dartium.dart |
| diff --git a/sdk/lib/typeddata/dartium/typeddata_dartium.dart b/sdk/lib/typeddata/dartium/typeddata_dartium.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7e466bc2263ddca9e71ea78ecd58c3edfa8cc293 |
| --- /dev/null |
| +++ b/sdk/lib/typeddata/dartium/typeddata_dartium.dart |
| @@ -0,0 +1,2470 @@ |
| +/// The Dart HTML library. |
| +library dart.typeddata; |
| + |
| +import 'dart:collection'; |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// DO NOT EDIT - unless you are editing documentation as per: |
| +// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation |
| +// Auto-generated dart:html library. |
| + |
| + |
| + |
| + |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('ArrayBuffer') |
| +@SupportedBrowser(SupportedBrowser.CHROME) |
| +@SupportedBrowser(SupportedBrowser.FIREFOX) |
| +@SupportedBrowser(SupportedBrowser.IE, '10') |
| +@SupportedBrowser(SupportedBrowser.SAFARI) |
| +class ByteBuffer extends NativeFieldWrapperClass1 { |
|
Mads Ager (google)
2013/03/19 10:09:09
This file should be empty for dartium since we wil
|
| + ByteBuffer.internal(); |
| + factory ByteBuffer(int length) => _create(length); |
| + |
| + @DocsEditable |
| + static ByteBuffer _create(length) native "ArrayBuffer_constructorCallback"; |
| + |
| + /// Checks if this type is supported on the current platform. |
| + static bool get supported => true; |
| + |
| + @DomName('ArrayBuffer.byteLength') |
| + @DocsEditable |
| + int get lengthInBytes native "ArrayBuffer_byteLength_Getter"; |
| + |
| + dynamic slice(int begin, [int end]) { |
|
Mads Ager (google)
2013/03/19 10:09:09
slice is not in dart:typeddata either. However, th
|
| + if (?end) { |
| + return _slice_1(begin, end); |
| + } |
| + return _slice_2(begin); |
| + } |
| + |
| + @DomName('ArrayBuffer._slice_1') |
| + @DocsEditable |
| + dynamic _slice_1(begin, end) native "ArrayBuffer__slice_1_Callback"; |
| + |
| + @DomName('ArrayBuffer._slice_2') |
| + @DocsEditable |
| + dynamic _slice_2(begin) native "ArrayBuffer__slice_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('DataView') |
| +class ByteData extends TypedData { |
| + ByteData.internal() : super.internal(); |
| + factory ByteData(/*ArrayBuffer*/ buffer, [int byteOffset, int byteLength]) => _create(buffer, byteOffset, byteLength); |
| + |
| + @DocsEditable |
| + static ByteData _create(buffer, byteOffset, byteLength) native "DataView_constructorCallback"; |
| + |
| + num getFloat32(int byteOffset, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + return _getFloat32_1(byteOffset, littleEndian); |
| + } |
| + return _getFloat32_2(byteOffset); |
| + } |
| + |
| + @DomName('DataView._getFloat32_1') |
| + @DocsEditable |
| + num _getFloat32_1(byteOffset, littleEndian) native "DataView__getFloat32_1_Callback"; |
| + |
| + @DomName('DataView._getFloat32_2') |
| + @DocsEditable |
| + num _getFloat32_2(byteOffset) native "DataView__getFloat32_2_Callback"; |
| + |
| + num getFloat64(int byteOffset, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + return _getFloat64_1(byteOffset, littleEndian); |
| + } |
| + return _getFloat64_2(byteOffset); |
| + } |
| + |
| + @DomName('DataView._getFloat64_1') |
| + @DocsEditable |
| + num _getFloat64_1(byteOffset, littleEndian) native "DataView__getFloat64_1_Callback"; |
| + |
| + @DomName('DataView._getFloat64_2') |
| + @DocsEditable |
| + num _getFloat64_2(byteOffset) native "DataView__getFloat64_2_Callback"; |
| + |
| + int getInt16(int byteOffset, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + return _getInt16_1(byteOffset, littleEndian); |
| + } |
| + return _getInt16_2(byteOffset); |
| + } |
| + |
| + @DomName('DataView._getInt16_1') |
| + @DocsEditable |
| + int _getInt16_1(byteOffset, littleEndian) native "DataView__getInt16_1_Callback"; |
| + |
| + @DomName('DataView._getInt16_2') |
| + @DocsEditable |
| + int _getInt16_2(byteOffset) native "DataView__getInt16_2_Callback"; |
| + |
| + int getInt32(int byteOffset, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + return _getInt32_1(byteOffset, littleEndian); |
| + } |
| + return _getInt32_2(byteOffset); |
| + } |
| + |
| + @DomName('DataView._getInt32_1') |
| + @DocsEditable |
| + int _getInt32_1(byteOffset, littleEndian) native "DataView__getInt32_1_Callback"; |
| + |
| + @DomName('DataView._getInt32_2') |
| + @DocsEditable |
| + int _getInt32_2(byteOffset) native "DataView__getInt32_2_Callback"; |
| + |
| + @DomName('DataView.getInt8') |
| + @DocsEditable |
| + int getInt8(int byteOffset) native "DataView_getInt8_Callback"; |
| + |
| + int getUint16(int byteOffset, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + return _getUint16_1(byteOffset, littleEndian); |
| + } |
| + return _getUint16_2(byteOffset); |
| + } |
| + |
| + @DomName('DataView._getUint16_1') |
| + @DocsEditable |
| + int _getUint16_1(byteOffset, littleEndian) native "DataView__getUint16_1_Callback"; |
| + |
| + @DomName('DataView._getUint16_2') |
| + @DocsEditable |
| + int _getUint16_2(byteOffset) native "DataView__getUint16_2_Callback"; |
| + |
| + int getUint32(int byteOffset, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + return _getUint32_1(byteOffset, littleEndian); |
| + } |
| + return _getUint32_2(byteOffset); |
| + } |
| + |
| + @DomName('DataView._getUint32_1') |
| + @DocsEditable |
| + int _getUint32_1(byteOffset, littleEndian) native "DataView__getUint32_1_Callback"; |
| + |
| + @DomName('DataView._getUint32_2') |
| + @DocsEditable |
| + int _getUint32_2(byteOffset) native "DataView__getUint32_2_Callback"; |
| + |
| + @DomName('DataView.getUint8') |
| + @DocsEditable |
| + int getUint8(int byteOffset) native "DataView_getUint8_Callback"; |
| + |
| + void setFloat32(int byteOffset, num value, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + _setFloat32_1(byteOffset, value, littleEndian); |
| + return; |
| + } |
| + _setFloat32_2(byteOffset, value); |
| + return; |
| + } |
| + |
| + @DomName('DataView._setFloat32_1') |
| + @DocsEditable |
| + void _setFloat32_1(byteOffset, value, littleEndian) native "DataView__setFloat32_1_Callback"; |
| + |
| + @DomName('DataView._setFloat32_2') |
| + @DocsEditable |
| + void _setFloat32_2(byteOffset, value) native "DataView__setFloat32_2_Callback"; |
| + |
| + void setFloat64(int byteOffset, num value, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + _setFloat64_1(byteOffset, value, littleEndian); |
| + return; |
| + } |
| + _setFloat64_2(byteOffset, value); |
| + return; |
| + } |
| + |
| + @DomName('DataView._setFloat64_1') |
| + @DocsEditable |
| + void _setFloat64_1(byteOffset, value, littleEndian) native "DataView__setFloat64_1_Callback"; |
| + |
| + @DomName('DataView._setFloat64_2') |
| + @DocsEditable |
| + void _setFloat64_2(byteOffset, value) native "DataView__setFloat64_2_Callback"; |
| + |
| + void setInt16(int byteOffset, int value, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + _setInt16_1(byteOffset, value, littleEndian); |
| + return; |
| + } |
| + _setInt16_2(byteOffset, value); |
| + return; |
| + } |
| + |
| + @DomName('DataView._setInt16_1') |
| + @DocsEditable |
| + void _setInt16_1(byteOffset, value, littleEndian) native "DataView__setInt16_1_Callback"; |
| + |
| + @DomName('DataView._setInt16_2') |
| + @DocsEditable |
| + void _setInt16_2(byteOffset, value) native "DataView__setInt16_2_Callback"; |
| + |
| + void setInt32(int byteOffset, int value, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + _setInt32_1(byteOffset, value, littleEndian); |
| + return; |
| + } |
| + _setInt32_2(byteOffset, value); |
| + return; |
| + } |
| + |
| + @DomName('DataView._setInt32_1') |
| + @DocsEditable |
| + void _setInt32_1(byteOffset, value, littleEndian) native "DataView__setInt32_1_Callback"; |
| + |
| + @DomName('DataView._setInt32_2') |
| + @DocsEditable |
| + void _setInt32_2(byteOffset, value) native "DataView__setInt32_2_Callback"; |
| + |
| + @DomName('DataView.setInt8') |
| + @DocsEditable |
| + void setInt8(int byteOffset, int value) native "DataView_setInt8_Callback"; |
| + |
| + void setUint16(int byteOffset, int value, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + _setUint16_1(byteOffset, value, littleEndian); |
| + return; |
| + } |
| + _setUint16_2(byteOffset, value); |
| + return; |
| + } |
| + |
| + @DomName('DataView._setUint16_1') |
| + @DocsEditable |
| + void _setUint16_1(byteOffset, value, littleEndian) native "DataView__setUint16_1_Callback"; |
| + |
| + @DomName('DataView._setUint16_2') |
| + @DocsEditable |
| + void _setUint16_2(byteOffset, value) native "DataView__setUint16_2_Callback"; |
| + |
| + void setUint32(int byteOffset, int value, {bool littleEndian}) { |
| + if (?littleEndian) { |
| + _setUint32_1(byteOffset, value, littleEndian); |
| + return; |
| + } |
| + _setUint32_2(byteOffset, value); |
| + return; |
| + } |
| + |
| + @DomName('DataView._setUint32_1') |
| + @DocsEditable |
| + void _setUint32_1(byteOffset, value, littleEndian) native "DataView__setUint32_1_Callback"; |
| + |
| + @DomName('DataView._setUint32_2') |
| + @DocsEditable |
| + void _setUint32_2(byteOffset, value) native "DataView__setUint32_2_Callback"; |
| + |
| + @DomName('DataView.setUint8') |
| + @DocsEditable |
| + void setUint8(int byteOffset, int value) native "DataView_setUint8_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Float32Array') |
| +class Float32List extends TypedData implements List<num> { |
| + Float32List.internal() : super.internal(); |
| + |
| + @DomName('Float32Array.Float32Array') |
| + @DocsEditable |
| + factory Float32List(int length) => |
| + _TypedArrayFactoryProvider.createFloat32List(length); |
| + |
| + @DomName('Float32Array.fromList') |
| + @DocsEditable |
| + factory Float32List.fromList(List<num> list) => |
| + _TypedArrayFactoryProvider.createFloat32List_fromList(list); |
| + |
| + @DomName('Float32Array.fromBuffer') |
| + @DocsEditable |
| + factory Float32List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createFloat32List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 4; |
| + |
| + @DomName('Float32Array.length') |
| + @DocsEditable |
| + int get length native "Float32Array_length_Getter"; |
| + |
| + @DomName('Float32Array.numericIndexGetter') |
| + @DocsEditable |
| + num operator[](int index) native "Float32Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Float32Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, num value) native "Float32Array_numericIndexSetter_Callback"; |
| + // -- start List<num> mixins. |
| + // num is the element type. |
| + |
| + // From Iterable<num>: |
| + |
| + Iterator<num> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<num>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, num)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(num element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(num element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<num> where(bool f(num element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(num element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<num> toList({ bool growable: true }) => |
| + new List<num>.from(this, growable: growable); |
| + |
| + Set<num> toSet() => new Set<num>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<num> takeWhile(bool test(num value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<num> skipWhile(bool test(num value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + num firstWhere(bool test(num value), { num orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + num lastWhere(bool test(num value), {num orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + num singleWhere(bool test(num value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + num elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<num>: |
| + |
| + void add(num value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(num value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<num> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<num>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<num> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(num a, num b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(num element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(num element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + num get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + num get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + num get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + num min([int compare(num a, num b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + num max([int compare(num a, num b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + num removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + num removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(num element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(num element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<num> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [num initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<num> getRange(int start, int rangeLength) => |
|
Mads Ager (google)
2013/03/19 10:09:09
On List this was renamed to sublist by lrn@. But m
|
| + Lists.getRange(this, start, rangeLength, <num>[]); |
| + |
| + Map<int, num> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<num> mixins. |
| + |
| + @DomName('Float32Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Float32Array_setElements_Callback"; |
| + |
| + List<double> subarray(int start, [int end]) { |
|
Mads Ager (google)
2013/03/19 10:09:09
subarray is not on the dart typeddata lists I thin
|
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Float32Array._subarray_1') |
| + @DocsEditable |
| + List<double> _subarray_1(start, end) native "Float32Array__subarray_1_Callback"; |
| + |
| + @DomName('Float32Array._subarray_2') |
| + @DocsEditable |
| + List<double> _subarray_2(start) native "Float32Array__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Float64Array') |
| +class Float64List extends TypedData implements List<num> { |
| + Float64List.internal() : super.internal(); |
| + |
| + @DomName('Float64Array.Float64Array') |
| + @DocsEditable |
| + factory Float64List(int length) => |
| + _TypedArrayFactoryProvider.createFloat64List(length); |
| + |
| + @DomName('Float64Array.fromList') |
| + @DocsEditable |
| + factory Float64List.fromList(List<num> list) => |
| + _TypedArrayFactoryProvider.createFloat64List_fromList(list); |
| + |
| + @DomName('Float64Array.fromBuffer') |
| + @DocsEditable |
| + factory Float64List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createFloat64List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 8; |
| + |
| + @DomName('Float64Array.length') |
| + @DocsEditable |
| + int get length native "Float64Array_length_Getter"; |
| + |
| + @DomName('Float64Array.numericIndexGetter') |
| + @DocsEditable |
| + num operator[](int index) native "Float64Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Float64Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, num value) native "Float64Array_numericIndexSetter_Callback"; |
| + // -- start List<num> mixins. |
| + // num is the element type. |
| + |
| + // From Iterable<num>: |
| + |
| + Iterator<num> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<num>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, num)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(num element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(num element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<num> where(bool f(num element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(num element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<num> toList({ bool growable: true }) => |
| + new List<num>.from(this, growable: growable); |
| + |
| + Set<num> toSet() => new Set<num>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<num> takeWhile(bool test(num value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<num> skipWhile(bool test(num value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + num firstWhere(bool test(num value), { num orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + num lastWhere(bool test(num value), {num orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + num singleWhere(bool test(num value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + num elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<num>: |
| + |
| + void add(num value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(num value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<num> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<num>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<num> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(num a, num b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(num element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(num element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + num get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + num get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + num get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + num min([int compare(num a, num b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + num max([int compare(num a, num b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + num removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + num removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(num element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(num element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<num> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [num initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<num> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <num>[]); |
| + |
| + Map<int, num> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<num> mixins. |
| + |
| + @DomName('Float64Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Float64Array_setElements_Callback"; |
| + |
| + List<double> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Float64Array._subarray_1') |
| + @DocsEditable |
| + List<double> _subarray_1(start, end) native "Float64Array__subarray_1_Callback"; |
| + |
| + @DomName('Float64Array._subarray_2') |
| + @DocsEditable |
| + List<double> _subarray_2(start) native "Float64Array__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Int16Array') |
| +class Int16List extends TypedData implements List<int> { |
| + Int16List.internal() : super.internal(); |
| + |
| + @DomName('Int16Array.Int16Array') |
| + @DocsEditable |
| + factory Int16List(int length) => |
| + _TypedArrayFactoryProvider.createInt16List(length); |
| + |
| + @DomName('Int16Array.fromList') |
| + @DocsEditable |
| + factory Int16List.fromList(List<int> list) => |
| + _TypedArrayFactoryProvider.createInt16List_fromList(list); |
| + |
| + @DomName('Int16Array.fromBuffer') |
| + @DocsEditable |
| + factory Int16List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createInt16List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 2; |
| + |
| + @DomName('Int16Array.length') |
| + @DocsEditable |
| + int get length native "Int16Array_length_Getter"; |
| + |
| + @DomName('Int16Array.numericIndexGetter') |
| + @DocsEditable |
| + int operator[](int index) native "Int16Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Int16Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, int value) native "Int16Array_numericIndexSetter_Callback"; |
| + // -- start List<int> mixins. |
| + // int is the element type. |
| + |
| + // From Iterable<int>: |
| + |
| + Iterator<int> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<int>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(int element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(int element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<int> where(bool f(int element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(int element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<int> toList({ bool growable: true }) => |
| + new List<int>.from(this, growable: growable); |
| + |
| + Set<int> toSet() => new Set<int>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<int> takeWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<int> skipWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + int firstWhere(bool test(int value), { int orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + int lastWhere(bool test(int value), {int orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + int singleWhere(bool test(int value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + int elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<int>: |
| + |
| + void add(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<int> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<int>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<int> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(int a, int b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(int element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(int element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + int get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + int min([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + int max([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + int removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + int removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [int initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<int> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <int>[]); |
| + |
| + Map<int, int> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<int> mixins. |
| + |
| + @DomName('Int16Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Int16Array_setElements_Callback"; |
| + |
| + List<int> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Int16Array._subarray_1') |
| + @DocsEditable |
| + List<int> _subarray_1(start, end) native "Int16Array__subarray_1_Callback"; |
| + |
| + @DomName('Int16Array._subarray_2') |
| + @DocsEditable |
| + List<int> _subarray_2(start) native "Int16Array__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Int32Array') |
| +class Int32List extends TypedData implements List<int> { |
| + Int32List.internal() : super.internal(); |
| + |
| + @DomName('Int32Array.Int32Array') |
| + @DocsEditable |
| + factory Int32List(int length) => |
| + _TypedArrayFactoryProvider.createInt32List(length); |
| + |
| + @DomName('Int32Array.fromList') |
| + @DocsEditable |
| + factory Int32List.fromList(List<int> list) => |
| + _TypedArrayFactoryProvider.createInt32List_fromList(list); |
| + |
| + @DomName('Int32Array.fromBuffer') |
| + @DocsEditable |
| + factory Int32List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createInt32List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 4; |
| + |
| + @DomName('Int32Array.length') |
| + @DocsEditable |
| + int get length native "Int32Array_length_Getter"; |
| + |
| + @DomName('Int32Array.numericIndexGetter') |
| + @DocsEditable |
| + int operator[](int index) native "Int32Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Int32Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, int value) native "Int32Array_numericIndexSetter_Callback"; |
| + // -- start List<int> mixins. |
| + // int is the element type. |
| + |
| + // From Iterable<int>: |
| + |
| + Iterator<int> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<int>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(int element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(int element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<int> where(bool f(int element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(int element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<int> toList({ bool growable: true }) => |
| + new List<int>.from(this, growable: growable); |
| + |
| + Set<int> toSet() => new Set<int>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<int> takeWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<int> skipWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + int firstWhere(bool test(int value), { int orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + int lastWhere(bool test(int value), {int orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + int singleWhere(bool test(int value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + int elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<int>: |
| + |
| + void add(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<int> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<int>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<int> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(int a, int b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(int element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(int element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + int get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + int min([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + int max([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + int removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + int removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [int initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<int> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <int>[]); |
| + |
| + Map<int, int> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<int> mixins. |
| + |
| + @DomName('Int32Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Int32Array_setElements_Callback"; |
| + |
| + List<int> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Int32Array._subarray_1') |
| + @DocsEditable |
| + List<int> _subarray_1(start, end) native "Int32Array__subarray_1_Callback"; |
| + |
| + @DomName('Int32Array._subarray_2') |
| + @DocsEditable |
| + List<int> _subarray_2(start) native "Int32Array__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Int8Array') |
| +class Int8List extends TypedData implements List<int> { |
| + Int8List.internal() : super.internal(); |
| + |
| + @DomName('Int8Array.Int8Array') |
| + @DocsEditable |
| + factory Int8List(int length) => |
| + _TypedArrayFactoryProvider.createInt8List(length); |
| + |
| + @DomName('Int8Array.fromList') |
| + @DocsEditable |
| + factory Int8List.fromList(List<int> list) => |
| + _TypedArrayFactoryProvider.createInt8List_fromList(list); |
| + |
| + @DomName('Int8Array.fromBuffer') |
| + @DocsEditable |
| + factory Int8List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createInt8List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 1; |
| + |
| + @DomName('Int8Array.length') |
| + @DocsEditable |
| + int get length native "Int8Array_length_Getter"; |
| + |
| + @DomName('Int8Array.numericIndexGetter') |
| + @DocsEditable |
| + int operator[](int index) native "Int8Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Int8Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, int value) native "Int8Array_numericIndexSetter_Callback"; |
| + // -- start List<int> mixins. |
| + // int is the element type. |
| + |
| + // From Iterable<int>: |
| + |
| + Iterator<int> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<int>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(int element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(int element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<int> where(bool f(int element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(int element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<int> toList({ bool growable: true }) => |
| + new List<int>.from(this, growable: growable); |
| + |
| + Set<int> toSet() => new Set<int>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<int> takeWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<int> skipWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + int firstWhere(bool test(int value), { int orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + int lastWhere(bool test(int value), {int orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + int singleWhere(bool test(int value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + int elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<int>: |
| + |
| + void add(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<int> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<int>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<int> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(int a, int b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(int element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(int element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + int get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + int min([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + int max([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + int removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + int removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [int initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<int> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <int>[]); |
| + |
| + Map<int, int> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<int> mixins. |
| + |
| + @DomName('Int8Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Int8Array_setElements_Callback"; |
| + |
| + List<int> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Int8Array._subarray_1') |
| + @DocsEditable |
| + List<int> _subarray_1(start, end) native "Int8Array__subarray_1_Callback"; |
| + |
| + @DomName('Int8Array._subarray_2') |
| + @DocsEditable |
| + List<int> _subarray_2(start) native "Int8Array__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('ArrayBufferView') |
| +@SupportedBrowser(SupportedBrowser.CHROME) |
| +@SupportedBrowser(SupportedBrowser.FIREFOX) |
| +@SupportedBrowser(SupportedBrowser.IE, '10') |
| +@SupportedBrowser(SupportedBrowser.SAFARI) |
| +class TypedData extends NativeFieldWrapperClass1 { |
| + TypedData.internal(); |
| + |
| + @DomName('ArrayBufferView.buffer') |
| + @DocsEditable |
| + dynamic get buffer native "ArrayBufferView_buffer_Getter"; |
| + |
| + @DomName('ArrayBufferView.byteLength') |
| + @DocsEditable |
| + int get lengthInBytes native "ArrayBufferView_byteLength_Getter"; |
| + |
| + @DomName('ArrayBufferView.byteOffset') |
| + @DocsEditable |
| + int get offsetInBytes native "ArrayBufferView_byteOffset_Getter"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Uint16Array') |
| +class Uint16List extends TypedData implements List<int> { |
| + Uint16List.internal() : super.internal(); |
| + |
| + @DomName('Uint16Array.Uint16Array') |
| + @DocsEditable |
| + factory Uint16List(int length) => |
| + _TypedArrayFactoryProvider.createUint16List(length); |
| + |
| + @DomName('Uint16Array.fromList') |
| + @DocsEditable |
| + factory Uint16List.fromList(List<int> list) => |
| + _TypedArrayFactoryProvider.createUint16List_fromList(list); |
| + |
| + @DomName('Uint16Array.fromBuffer') |
| + @DocsEditable |
| + factory Uint16List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createUint16List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 2; |
| + |
| + @DomName('Uint16Array.length') |
| + @DocsEditable |
| + int get length native "Uint16Array_length_Getter"; |
| + |
| + @DomName('Uint16Array.numericIndexGetter') |
| + @DocsEditable |
| + int operator[](int index) native "Uint16Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Uint16Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, int value) native "Uint16Array_numericIndexSetter_Callback"; |
| + // -- start List<int> mixins. |
| + // int is the element type. |
| + |
| + // From Iterable<int>: |
| + |
| + Iterator<int> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<int>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(int element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(int element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<int> where(bool f(int element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(int element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<int> toList({ bool growable: true }) => |
| + new List<int>.from(this, growable: growable); |
| + |
| + Set<int> toSet() => new Set<int>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<int> takeWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<int> skipWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + int firstWhere(bool test(int value), { int orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + int lastWhere(bool test(int value), {int orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + int singleWhere(bool test(int value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + int elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<int>: |
| + |
| + void add(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<int> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<int>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<int> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(int a, int b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(int element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(int element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + int get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + int min([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + int max([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + int removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + int removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [int initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<int> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <int>[]); |
| + |
| + Map<int, int> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<int> mixins. |
| + |
| + @DomName('Uint16Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Uint16Array_setElements_Callback"; |
| + |
| + List<int> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Uint16Array._subarray_1') |
| + @DocsEditable |
| + List<int> _subarray_1(start, end) native "Uint16Array__subarray_1_Callback"; |
| + |
| + @DomName('Uint16Array._subarray_2') |
| + @DocsEditable |
| + List<int> _subarray_2(start) native "Uint16Array__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Uint32Array') |
| +class Uint32List extends TypedData implements List<int> { |
| + Uint32List.internal() : super.internal(); |
| + |
| + @DomName('Uint32Array.Uint32Array') |
| + @DocsEditable |
| + factory Uint32List(int length) => |
| + _TypedArrayFactoryProvider.createUint32List(length); |
| + |
| + @DomName('Uint32Array.fromList') |
| + @DocsEditable |
| + factory Uint32List.fromList(List<int> list) => |
| + _TypedArrayFactoryProvider.createUint32List_fromList(list); |
| + |
| + @DomName('Uint32Array.fromBuffer') |
| + @DocsEditable |
| + factory Uint32List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createUint32List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 4; |
| + |
| + @DomName('Uint32Array.length') |
| + @DocsEditable |
| + int get length native "Uint32Array_length_Getter"; |
| + |
| + @DomName('Uint32Array.numericIndexGetter') |
| + @DocsEditable |
| + int operator[](int index) native "Uint32Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Uint32Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, int value) native "Uint32Array_numericIndexSetter_Callback"; |
| + // -- start List<int> mixins. |
| + // int is the element type. |
| + |
| + // From Iterable<int>: |
| + |
| + Iterator<int> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<int>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(int element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(int element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<int> where(bool f(int element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(int element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<int> toList({ bool growable: true }) => |
| + new List<int>.from(this, growable: growable); |
| + |
| + Set<int> toSet() => new Set<int>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<int> takeWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<int> skipWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + int firstWhere(bool test(int value), { int orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + int lastWhere(bool test(int value), {int orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + int singleWhere(bool test(int value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + int elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<int>: |
| + |
| + void add(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<int> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<int>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<int> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(int a, int b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(int element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(int element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + int get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + int min([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + int max([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + int removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + int removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [int initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<int> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <int>[]); |
| + |
| + Map<int, int> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<int> mixins. |
| + |
| + @DomName('Uint32Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Uint32Array_setElements_Callback"; |
| + |
| + List<int> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Uint32Array._subarray_1') |
| + @DocsEditable |
| + List<int> _subarray_1(start, end) native "Uint32Array__subarray_1_Callback"; |
| + |
| + @DomName('Uint32Array._subarray_2') |
| + @DocsEditable |
| + List<int> _subarray_2(start) native "Uint32Array__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Uint8ClampedArray') |
| +class Uint8ClampedList extends Uint8List implements List<int> { |
| + Uint8ClampedList.internal() : super.internal(); |
| + |
| + @DomName('Uint8ClampedArray.Uint8ClampedArray') |
| + @DocsEditable |
| + factory Uint8ClampedList(int length) => |
| + _TypedArrayFactoryProvider.createUint8ClampedList(length); |
| + |
| + @DomName('Uint8ClampedArray.fromList') |
| + @DocsEditable |
| + factory Uint8ClampedList.fromList(List<int> list) => |
| + _TypedArrayFactoryProvider.createUint8ClampedList_fromList(list); |
| + |
| + @DomName('Uint8ClampedArray.fromBuffer') |
| + @DocsEditable |
| + factory Uint8ClampedList.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createUint8ClampedList_fromBuffer(buffer, byteOffset, length); |
| + |
| + @DomName('Uint8ClampedArray.length') |
| + @DocsEditable |
| + int get length native "Uint8ClampedArray_length_Getter"; |
| + |
| + @DomName('Uint8ClampedArray.numericIndexGetter') |
| + @DocsEditable |
| + int operator[](int index) native "Uint8ClampedArray_numericIndexGetter_Callback"; |
| + |
| + @DomName('Uint8ClampedArray.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, int value) native "Uint8ClampedArray_numericIndexSetter_Callback"; |
| + // -- start List<int> mixins. |
| + // int is the element type. |
| + |
| + // From Iterable<int>: |
| + |
| + Iterator<int> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<int>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(int element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(int element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<int> where(bool f(int element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(int element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<int> toList({ bool growable: true }) => |
| + new List<int>.from(this, growable: growable); |
| + |
| + Set<int> toSet() => new Set<int>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<int> takeWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<int> skipWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + int firstWhere(bool test(int value), { int orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + int lastWhere(bool test(int value), {int orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + int singleWhere(bool test(int value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + int elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<int>: |
| + |
| + void add(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<int> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<int>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<int> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(int a, int b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(int element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(int element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + int get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + int min([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + int max([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + int removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + int removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [int initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<int> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <int>[]); |
| + |
| + Map<int, int> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<int> mixins. |
| + |
| + @DomName('Uint8ClampedArray.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Uint8ClampedArray_setElements_Callback"; |
| + |
| + List<int> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Uint8ClampedArray._subarray_1') |
| + @DocsEditable |
| + List<int> _subarray_1(start, end) native "Uint8ClampedArray__subarray_1_Callback"; |
| + |
| + @DomName('Uint8ClampedArray._subarray_2') |
| + @DocsEditable |
| + List<int> _subarray_2(start) native "Uint8ClampedArray__subarray_2_Callback"; |
| + |
| +} |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// WARNING: Do not edit - generated code. |
| + |
| + |
| +@DocsEditable |
| +@DomName('Uint8Array') |
| +class Uint8List extends TypedData implements List<int> { |
| + Uint8List.internal() : super.internal(); |
| + |
| + @DomName('Uint8Array.Uint8Array') |
| + @DocsEditable |
| + factory Uint8List(int length) => |
| + _TypedArrayFactoryProvider.createUint8List(length); |
| + |
| + @DomName('Uint8Array.fromList') |
| + @DocsEditable |
| + factory Uint8List.fromList(List<int> list) => |
| + _TypedArrayFactoryProvider.createUint8List_fromList(list); |
| + |
| + @DomName('Uint8Array.fromBuffer') |
| + @DocsEditable |
| + factory Uint8List.view(ByteBuffer buffer, [int byteOffset, int length]) => |
| + _TypedArrayFactoryProvider.createUint8List_fromBuffer(buffer, byteOffset, length); |
| + |
| + static const int BYTES_PER_ELEMENT = 1; |
| + |
| + @DomName('Uint8Array.length') |
| + @DocsEditable |
| + int get length native "Uint8Array_length_Getter"; |
| + |
| + @DomName('Uint8Array.numericIndexGetter') |
| + @DocsEditable |
| + int operator[](int index) native "Uint8Array_numericIndexGetter_Callback"; |
| + |
| + @DomName('Uint8Array.numericIndexSetter') |
| + @DocsEditable |
| + void operator[]=(int index, int value) native "Uint8Array_numericIndexSetter_Callback"; |
| + // -- start List<int> mixins. |
| + // int is the element type. |
| + |
| + // From Iterable<int>: |
| + |
| + Iterator<int> get iterator { |
| + // Note: NodeLists are not fixed size. And most probably length shouldn't |
| + // be cached in both iterator _and_ forEach method. For now caching it |
| + // for consistency. |
| + return new FixedSizeListIterator<int>(this); |
| + } |
| + |
| + dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) { |
| + return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| + } |
| + |
| + bool contains(int element) => IterableMixinWorkaround.contains(this, element); |
| + |
| + void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f); |
| + |
| + String join([String separator]) => |
| + IterableMixinWorkaround.joinList(this, separator); |
| + |
| + Iterable map(f(int element)) => |
| + IterableMixinWorkaround.mapList(this, f); |
| + |
| + Iterable<int> where(bool f(int element)) => |
| + IterableMixinWorkaround.where(this, f); |
| + |
| + Iterable expand(Iterable f(int element)) => |
| + IterableMixinWorkaround.expand(this, f); |
| + |
| + bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f); |
| + |
| + bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); |
| + |
| + List<int> toList({ bool growable: true }) => |
| + new List<int>.from(this, growable: growable); |
| + |
| + Set<int> toSet() => new Set<int>.from(this); |
| + |
| + bool get isEmpty => this.length == 0; |
| + |
| + Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); |
| + |
| + Iterable<int> takeWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.takeWhile(this, test); |
| + } |
| + |
| + Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); |
| + |
| + Iterable<int> skipWhile(bool test(int value)) { |
| + return IterableMixinWorkaround.skipWhile(this, test); |
| + } |
| + |
| + int firstWhere(bool test(int value), { int orElse() }) { |
| + return IterableMixinWorkaround.firstWhere(this, test, orElse); |
| + } |
| + |
| + int lastWhere(bool test(int value), {int orElse()}) { |
| + return IterableMixinWorkaround.lastWhereList(this, test, orElse); |
| + } |
| + |
| + int singleWhere(bool test(int value)) { |
| + return IterableMixinWorkaround.singleWhere(this, test); |
| + } |
| + |
| + int elementAt(int index) { |
| + return this[index]; |
| + } |
| + |
| + // From Collection<int>: |
| + |
| + void add(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addLast(int value) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + void addAll(Iterable<int> iterable) { |
| + throw new UnsupportedError("Cannot add to immutable List."); |
| + } |
| + |
| + // From List<int>: |
| + void set length(int value) { |
| + throw new UnsupportedError("Cannot resize immutable List."); |
| + } |
| + |
| + void clear() { |
| + throw new UnsupportedError("Cannot clear immutable List."); |
| + } |
| + |
| + Iterable<int> get reversed { |
| + return IterableMixinWorkaround.reversedList(this); |
| + } |
| + |
| + void sort([int compare(int a, int b)]) { |
| + throw new UnsupportedError("Cannot sort immutable List."); |
| + } |
| + |
| + int indexOf(int element, [int start = 0]) => |
| + Lists.indexOf(this, element, start, this.length); |
| + |
| + int lastIndexOf(int element, [int start]) { |
| + if (start == null) start = length - 1; |
| + return Lists.lastIndexOf(this, element, start); |
| + } |
| + |
| + int get first { |
| + if (this.length > 0) return this[0]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get last { |
| + if (this.length > 0) return this[this.length - 1]; |
| + throw new StateError("No elements"); |
| + } |
| + |
| + int get single { |
| + if (length == 1) return this[0]; |
| + if (length == 0) throw new StateError("No elements"); |
| + throw new StateError("More than one element"); |
| + } |
| + |
| + int min([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.min(this, compare); |
| + |
| + int max([int compare(int a, int b)]) => |
| + IterableMixinWorkaround.max(this, compare); |
| + |
| + int removeAt(int pos) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + int removeLast() { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void remove(Object object) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainAll(Iterable elements) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void removeWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void retainWhere(bool test(int element)) { |
| + throw new UnsupportedError("Cannot remove from immutable List."); |
| + } |
| + |
| + void setRange(int start, int rangeLength, List<int> from, [int startFrom]) { |
| + throw new UnsupportedError("Cannot setRange on immutable List."); |
| + } |
| + |
| + void removeRange(int start, int rangeLength) { |
| + throw new UnsupportedError("Cannot removeRange on immutable List."); |
| + } |
| + |
| + void insertRange(int start, int rangeLength, [int initialValue]) { |
| + throw new UnsupportedError("Cannot insertRange on immutable List."); |
| + } |
| + |
| + List<int> getRange(int start, int rangeLength) => |
| + Lists.getRange(this, start, rangeLength, <int>[]); |
| + |
| + Map<int, int> asMap() => |
| + IterableMixinWorkaround.asMapList(this); |
| + |
| + // -- end List<int> mixins. |
| + |
| + @DomName('Uint8Array.setElements') |
| + @DocsEditable |
| + void setElements(Object array, [int offset]) native "Uint8Array_setElements_Callback"; |
| + |
| + List<int> subarray(int start, [int end]) { |
| + if (?end) { |
| + return _subarray_1(start, end); |
| + } |
| + return _subarray_2(start); |
| + } |
| + |
| + @DomName('Uint8Array._subarray_1') |
| + @DocsEditable |
| + List<int> _subarray_1(start, end) native "Uint8Array__subarray_1_Callback"; |
| + |
| + @DomName('Uint8Array._subarray_2') |
| + @DocsEditable |
| + List<int> _subarray_2(start) native "Uint8Array__subarray_2_Callback"; |
| + |
| +} |