| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.dom.html; | 5 part of dart.dom.html; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A list which just wraps another list, for either intercepting list calls or | 8 * A list which just wraps another list, for either intercepting list calls or |
| 9 * retyping the list (for example, from List<A> to List<B> where B extends A). | 9 * retyping the list (for example, from List<A> to List<B> where B extends A). |
| 10 */ | 10 */ |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 Iterable<E> get reversed => _list.reversed; | 97 Iterable<E> get reversed => _list.reversed; |
| 98 | 98 |
| 99 void sort([int compare(E a, E b)]) { _list.sort(compare); } | 99 void sort([int compare(E a, E b)]) { _list.sort(compare); } |
| 100 | 100 |
| 101 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start); | 101 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start); |
| 102 | 102 |
| 103 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start); | 103 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start); |
| 104 | 104 |
| 105 void insert(int index, E element) => _list.insert(index, element); | 105 void insert(int index, E element) => _list.insert(index, element); |
| 106 | 106 |
| 107 void insertAll(int index, Iterable<E> iterable) => |
| 108 _list.insertAll(index, iterable); |
| 109 |
| 110 void setAll(int index, Iterable<E> iterable) => |
| 111 _list.setAll(index, iterable); |
| 112 |
| 107 E removeAt(int index) => _list.removeAt(index); | 113 E removeAt(int index) => _list.removeAt(index); |
| 108 | 114 |
| 109 E removeLast() => _list.removeLast(); | 115 E removeLast() => _list.removeLast(); |
| 110 | 116 |
| 111 List<E> sublist(int start, [int end]) => _list.sublist(start, end); | 117 List<E> sublist(int start, [int end]) => _list.sublist(start, end); |
| 112 | 118 |
| 113 Iterable<E> getRange(int start, int end) => _list.getRange(start, end); | 119 Iterable<E> getRange(int start, int end) => _list.getRange(start, end); |
| 114 | 120 |
| 115 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { | 121 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { |
| 116 _list.setRange(start, end, iterable, skipCount); | 122 _list.setRange(start, end, iterable, skipCount); |
| 117 } | 123 } |
| 118 | 124 |
| 119 void removeRange(int start, int end) { _list.removeRange(start, end); } | 125 void removeRange(int start, int end) { _list.removeRange(start, end); } |
| 120 | 126 |
| 127 void replaceRange(int start, int end, Iterable<E> iterable) { |
| 128 _list.replaceRange(start, end, iterable); |
| 129 } |
| 130 |
| 131 void fillRange(int start, int end, [E fillValue]) { |
| 132 _list.fillRange(start, end, fillValue); |
| 133 } |
| 134 |
| 121 Map<int, E> asMap() => _list.asMap(); | 135 Map<int, E> asMap() => _list.asMap(); |
| 122 | 136 |
| 123 String toString() { | 137 String toString() { |
| 124 StringBuffer buffer = new StringBuffer('['); | 138 StringBuffer buffer = new StringBuffer('['); |
| 125 buffer.writeAll(this, ', '); | 139 buffer.writeAll(this, ', '); |
| 126 buffer.write(']'); | 140 buffer.write(']'); |
| 127 return buffer.toString(); | 141 return buffer.toString(); |
| 128 } | 142 } |
| 129 } | 143 } |
| 130 | 144 |
| 131 /** | 145 /** |
| 132 * Iterator wrapper for _WrappedList. | 146 * Iterator wrapper for _WrappedList. |
| 133 */ | 147 */ |
| 134 class _WrappedIterator<E> implements Iterator<E> { | 148 class _WrappedIterator<E> implements Iterator<E> { |
| 135 Iterator _iterator; | 149 Iterator _iterator; |
| 136 | 150 |
| 137 _WrappedIterator(this._iterator); | 151 _WrappedIterator(this._iterator); |
| 138 | 152 |
| 139 bool moveNext() { | 153 bool moveNext() { |
| 140 return _iterator.moveNext(); | 154 return _iterator.moveNext(); |
| 141 } | 155 } |
| 142 | 156 |
| 143 E get current => _iterator.current; | 157 E get current => _iterator.current; |
| 144 } | 158 } |
| OLD | NEW |