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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void clear() { _list.clear(); } | 92 void clear() { _list.clear(); } |
93 | 93 |
94 // List APIs | 94 // List APIs |
95 | 95 |
96 E operator [](int index) => _list[index]; | 96 E operator [](int index) => _list[index]; |
97 | 97 |
98 void operator []=(int index, E value) { _list[index] = value; } | 98 void operator []=(int index, E value) { _list[index] = value; } |
99 | 99 |
100 void set length(int newLength) { _list.length = newLength; } | 100 void set length(int newLength) { _list.length = newLength; } |
101 | 101 |
102 void addLast(E value) { _list.add(value); } | |
103 | |
104 Iterable<E> get reversed => _list.reversed; | 102 Iterable<E> get reversed => _list.reversed; |
105 | 103 |
106 void sort([int compare(E a, E b)]) { _list.sort(compare); } | 104 void sort([int compare(E a, E b)]) { _list.sort(compare); } |
107 | 105 |
108 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start); | 106 int indexOf(E element, [int start = 0]) => _list.indexOf(element, start); |
109 | 107 |
110 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start); | 108 int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start); |
111 | 109 |
112 void insert(int index, E element) => _list.insert(index, element); | 110 void insert(int index, E element) => _list.insert(index, element); |
113 | 111 |
(...skipping 25 matching lines...) Expand all Loading... |
139 Iterator _iterator; | 137 Iterator _iterator; |
140 | 138 |
141 _WrappedIterator(this._iterator); | 139 _WrappedIterator(this._iterator); |
142 | 140 |
143 bool moveNext() { | 141 bool moveNext() { |
144 return _iterator.moveNext(); | 142 return _iterator.moveNext(); |
145 } | 143 } |
146 | 144 |
147 E get current => _iterator.current; | 145 E get current => _iterator.current; |
148 } | 146 } |
OLD | NEW |