OLD | NEW |
(Empty) | |
| 1 |
| 2 class _MediaListImpl extends _DOMTypeBase implements MediaList { |
| 3 _MediaListImpl._wrap(ptr) : super._wrap(ptr); |
| 4 |
| 5 int get length() => _wrap(_ptr.length); |
| 6 |
| 7 String get mediaText() => _wrap(_ptr.mediaText); |
| 8 |
| 9 void set mediaText(String value) { _ptr.mediaText = _unwrap(value); } |
| 10 |
| 11 String operator[](int index) => _wrap(_ptr[index]); |
| 12 |
| 13 |
| 14 void operator[]=(int index, String value) { |
| 15 throw new UnsupportedOperationException("Cannot assign element of immutable
List."); |
| 16 } |
| 17 |
| 18 void add(String value) { |
| 19 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 20 } |
| 21 |
| 22 void addLast(String value) { |
| 23 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 24 } |
| 25 |
| 26 void addAll(Collection<String> collection) { |
| 27 throw new UnsupportedOperationException("Cannot add to immutable List."); |
| 28 } |
| 29 |
| 30 void sort(int compare(String a, String b)) { |
| 31 throw new UnsupportedOperationException("Cannot sort immutable List."); |
| 32 } |
| 33 |
| 34 void copyFrom(List<Object> src, int srcStart, int dstStart, int count) { |
| 35 throw new UnsupportedOperationException("This object is immutable."); |
| 36 } |
| 37 |
| 38 int indexOf(String element, [int start = 0]) { |
| 39 return _Lists.indexOf(this, element, start, this.length); |
| 40 } |
| 41 |
| 42 int lastIndexOf(String element, [int start = null]) { |
| 43 if (start === null) start = length - 1; |
| 44 return _Lists.lastIndexOf(this, element, start); |
| 45 } |
| 46 |
| 47 int clear() { |
| 48 throw new UnsupportedOperationException("Cannot clear immutable List."); |
| 49 } |
| 50 |
| 51 String removeLast() { |
| 52 throw new UnsupportedOperationException("Cannot removeLast on immutable List
."); |
| 53 } |
| 54 |
| 55 String last() { |
| 56 return this[length - 1]; |
| 57 } |
| 58 |
| 59 void forEach(void f(String element)) { |
| 60 _Collections.forEach(this, f); |
| 61 } |
| 62 |
| 63 Collection map(f(String element)) { |
| 64 return _Collections.map(this, [], f); |
| 65 } |
| 66 |
| 67 Collection<String> filter(bool f(String element)) { |
| 68 return _Collections.filter(this, new List<String>(), f); |
| 69 } |
| 70 |
| 71 bool every(bool f(String element)) { |
| 72 return _Collections.every(this, f); |
| 73 } |
| 74 |
| 75 bool some(bool f(String element)) { |
| 76 return _Collections.some(this, f); |
| 77 } |
| 78 |
| 79 void setRange(int start, int length, List<String> from, [int startFrom]) { |
| 80 throw new UnsupportedOperationException("Cannot setRange on immutable List."
); |
| 81 } |
| 82 |
| 83 void removeRange(int start, int length) { |
| 84 throw new UnsupportedOperationException("Cannot removeRange on immutable Lis
t."); |
| 85 } |
| 86 |
| 87 void insertRange(int start, int length, [String initialValue]) { |
| 88 throw new UnsupportedOperationException("Cannot insertRange on immutable Lis
t."); |
| 89 } |
| 90 |
| 91 List<String> getRange(int start, int length) { |
| 92 throw new NotImplementedException(); |
| 93 } |
| 94 |
| 95 bool isEmpty() { |
| 96 return length == 0; |
| 97 } |
| 98 |
| 99 Iterator<String> iterator() { |
| 100 return new _FixedSizeListIterator<String>(this); |
| 101 } |
| 102 |
| 103 void appendMedium(String newMedium) { |
| 104 _ptr.appendMedium(_unwrap(newMedium)); |
| 105 return; |
| 106 } |
| 107 |
| 108 void deleteMedium(String oldMedium) { |
| 109 _ptr.deleteMedium(_unwrap(oldMedium)); |
| 110 return; |
| 111 } |
| 112 |
| 113 String item(int index) { |
| 114 return _wrap(_ptr.item(_unwrap(index))); |
| 115 } |
| 116 } |
OLD | NEW |