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 16 matching lines...) Expand all Loading... |
27 bool remove(Object element) => _list.remove(element); | 27 bool remove(Object element) => _list.remove(element); |
28 | 28 |
29 void clear() { _list.clear(); } | 29 void clear() { _list.clear(); } |
30 | 30 |
31 // List APIs | 31 // List APIs |
32 | 32 |
33 E operator [](int index) => _list[index]; | 33 E operator [](int index) => _list[index]; |
34 | 34 |
35 void operator []=(int index, E value) { _list[index] = value; } | 35 void operator []=(int index, E value) { _list[index] = value; } |
36 | 36 |
37 set length(int newLength) { _list.length = newLength; } | 37 void set length(int newLength) { _list.length = newLength; } |
38 | 38 |
39 void sort([int compare(E a, E b)]) { _list.sort(compare); } | 39 void sort([int compare(E a, E b)]) { _list.sort(compare); } |
40 | 40 |
41 int indexOf(Object element, [int start = 0]) => _list.indexOf(element, start); | 41 int indexOf(Object element, [int start = 0]) => _list.indexOf(element, start); |
42 | 42 |
43 int lastIndexOf(Object element, [int start]) => _list.lastIndexOf(element, sta
rt); | 43 int lastIndexOf(Object element, [int start]) => _list.lastIndexOf(element, sta
rt); |
44 | 44 |
45 void insert(int index, E element) => _list.insert(index, element); | 45 void insert(int index, E element) => _list.insert(index, element); |
46 | 46 |
47 E removeAt(int index) => _list.removeAt(index); | 47 E removeAt(int index) => _list.removeAt(index); |
(...skipping 22 matching lines...) Expand all Loading... |
70 Iterator _iterator; | 70 Iterator _iterator; |
71 | 71 |
72 _WrappedIterator(this._iterator); | 72 _WrappedIterator(this._iterator); |
73 | 73 |
74 bool moveNext() { | 74 bool moveNext() { |
75 return _iterator.moveNext(); | 75 return _iterator.moveNext(); |
76 } | 76 } |
77 | 77 |
78 E get current => _iterator.current; | 78 E get current => _iterator.current; |
79 } | 79 } |
OLD | NEW |