| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 // WARNING: Do not edit - generated code. | |
| 6 | |
| 7 class _Int8ArrayWrappingImplementation extends _ArrayBufferViewWrappingImplement
ation implements Int8Array { | |
| 8 _Int8ArrayWrappingImplementation() : super() {} | |
| 9 | |
| 10 static create__Int8ArrayWrappingImplementation() native { | |
| 11 return new _Int8ArrayWrappingImplementation(); | |
| 12 } | |
| 13 | |
| 14 int get length() { return _get_length(this); } | |
| 15 static int _get_length(var _this) native; | |
| 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 map(f(int element)) { | |
| 71 return _Collections.map(this, [], f); | |
| 72 } | |
| 73 | |
| 74 Collection<int> filter(bool f(int element)) { | |
| 75 return _Collections.filter(this, new List<int>(), f); | |
| 76 } | |
| 77 | |
| 78 bool every(bool f(int element)) { | |
| 79 return _Collections.every(this, f); | |
| 80 } | |
| 81 | |
| 82 bool some(bool f(int element)) { | |
| 83 return _Collections.some(this, f); | |
| 84 } | |
| 85 | |
| 86 void setRange(int start, int length, List<int> from, [int startFrom]) { | |
| 87 throw new UnsupportedOperationException("Cannot setRange on immutable List."
); | |
| 88 } | |
| 89 | |
| 90 void removeRange(int start, int length) { | |
| 91 throw new UnsupportedOperationException("Cannot removeRange on immutable Lis
t."); | |
| 92 } | |
| 93 | |
| 94 void insertRange(int start, int length, [int initialValue]) { | |
| 95 throw new UnsupportedOperationException("Cannot insertRange on immutable Lis
t."); | |
| 96 } | |
| 97 | |
| 98 List<int> getRange(int start, int length) { | |
| 99 throw new NotImplementedException(); | |
| 100 } | |
| 101 | |
| 102 bool isEmpty() { | |
| 103 return length == 0; | |
| 104 } | |
| 105 | |
| 106 Iterator<int> iterator() { | |
| 107 return new _FixedSizeListIterator<int>(this); | |
| 108 } | |
| 109 | |
| 110 void setElements(Object array, [int offset = null]) { | |
| 111 if (offset === null) { | |
| 112 _setElements(this, array); | |
| 113 return; | |
| 114 } else { | |
| 115 _setElements_2(this, array, offset); | |
| 116 return; | |
| 117 } | |
| 118 } | |
| 119 static void _setElements(receiver, array) native; | |
| 120 static void _setElements_2(receiver, array, offset) native; | |
| 121 | |
| 122 Int8Array subarray(int start, [int end = null]) { | |
| 123 if (end === null) { | |
| 124 return _subarray(this, start); | |
| 125 } else { | |
| 126 return _subarray_2(this, start, end); | |
| 127 } | |
| 128 } | |
| 129 static Int8Array _subarray(receiver, start) native; | |
| 130 static Int8Array _subarray_2(receiver, start, end) native; | |
| 131 | |
| 132 String get typeName() { return "Int8Array"; } | |
| 133 } | |
| OLD | NEW |