| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // WARNING: Do not edit - generated code. | 5 // WARNING: Do not edit - generated code. |
| 6 | 6 |
| 7 class _Int16ArrayWrappingImplementation extends _ArrayBufferViewWrappingImplemen
tation implements Int16Array { | 7 class _Int16ArrayWrappingImplementation extends _ArrayBufferViewWrappingImplemen
tation implements Int16Array { |
| 8 _Int16ArrayWrappingImplementation() : super() {} | 8 _Int16ArrayWrappingImplementation() : super() {} |
| 9 | 9 |
| 10 static create__Int16ArrayWrappingImplementation() native { | 10 static create__Int16ArrayWrappingImplementation() native { |
| 11 return new _Int16ArrayWrappingImplementation(); | 11 return new _Int16ArrayWrappingImplementation(); |
| 12 } | 12 } |
| 13 | 13 |
| 14 int get length() { return _get_length(this); } | 14 int get length() { return _get_length(this); } |
| 15 static int _get_length(var _this) native; | 15 static int _get_length(var _this) native; |
| 16 | 16 |
| 17 int operator[](int index) { return _index(this, index); } |
| 18 static int _index(var _this, int index) native; |
| 19 |
| 20 void operator[]=(int index, int value) { |
| 21 return _set_index(this, index, value); |
| 22 } |
| 23 static _set_index(_this, index, value) native; |
| 24 |
| 25 void add(int value) { |
| 26 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 27 } |
| 28 |
| 29 void addLast(int value) { |
| 30 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 31 } |
| 32 |
| 33 void addAll(Collection<int> collection) { |
| 34 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 35 } |
| 36 |
| 37 void sort(int compare(int a, int b)) { |
| 38 throw new UnsupportedOperationException("Cannot sort immutable List."); |
| 39 } |
| 40 |
| 41 void copyFrom(List<Object> src, int srcStart, int dstStart, int count) { |
| 42 throw new UnsupportedOperationException("This object is immutable."); |
| 43 } |
| 44 |
| 45 int indexOf(int element, [int start = 0]) { |
| 46 return _Lists.indexOf(this, element, start, this.length); |
| 47 } |
| 48 |
| 49 int lastIndexOf(int element, [int start = null]) { |
| 50 if (start === null) start = length - 1; |
| 51 return _Lists.lastIndexOf(this, element, start); |
| 52 } |
| 53 |
| 54 int clear() { |
| 55 throw new UnsupportedOperationException("Cannot clear immutable List."); |
| 56 } |
| 57 |
| 58 int removeLast() { |
| 59 throw new UnsupportedOperationException("Cannot removeLast on immutable List
."); |
| 60 } |
| 61 |
| 62 int last() { |
| 63 return this[length - 1]; |
| 64 } |
| 65 |
| 66 void forEach(void f(int element)) { |
| 67 _Collections.forEach(this, f); |
| 68 } |
| 69 |
| 70 Collection<int> filter(bool f(int element)) { |
| 71 return _Collections.filter(this, new List<int>(), f); |
| 72 } |
| 73 |
| 74 bool every(bool f(int element)) { |
| 75 return _Collections.every(this, f); |
| 76 } |
| 77 |
| 78 bool some(bool f(int element)) { |
| 79 return _Collections.some(this, f); |
| 80 } |
| 81 |
| 82 void setRange(int start, int length, List<int> from, [int startFrom]) { |
| 83 throw new UnsupportedOperationException("Cannot setRange on immutable List."
); |
| 84 } |
| 85 |
| 86 void removeRange(int start, int length) { |
| 87 throw new UnsupportedOperationException("Cannot removeRange on immutable Lis
t."); |
| 88 } |
| 89 |
| 90 void insertRange(int start, int length, [int initialValue]) { |
| 91 throw new UnsupportedOperationException("Cannot insertRange on immutable Lis
t."); |
| 92 } |
| 93 |
| 94 List<int> getRange(int start, int length) { |
| 95 throw new NotImplementedException(); |
| 96 } |
| 97 |
| 98 bool isEmpty() { |
| 99 return length == 0; |
| 100 } |
| 101 |
| 102 Iterator<int> iterator() { |
| 103 return new _FixedSizeListIterator<int>(this); |
| 104 } |
| 105 |
| 17 Int16Array subarray(int start, [int end = null]) { | 106 Int16Array subarray(int start, [int end = null]) { |
| 18 if (end === null) { | 107 if (end === null) { |
| 19 return _subarray(this, start); | 108 return _subarray(this, start); |
| 20 } else { | 109 } else { |
| 21 return _subarray_2(this, start, end); | 110 return _subarray_2(this, start, end); |
| 22 } | 111 } |
| 23 } | 112 } |
| 24 static Int16Array _subarray(receiver, start) native; | 113 static Int16Array _subarray(receiver, start) native; |
| 25 static Int16Array _subarray_2(receiver, start, end) native; | 114 static Int16Array _subarray_2(receiver, start, end) native; |
| 26 | 115 |
| 27 String get typeName() { return "Int16Array"; } | 116 String get typeName() { return "Int16Array"; } |
| 28 } | 117 } |
| OLD | NEW |