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 */ |
11 class _WrappedList<E extends Node> extends ListBase<E> | 11 class _WrappedList<E extends Node> extends ListBase<E> |
12 implements NodeListWrapper { | 12 implements NodeListWrapper { |
13 final List<Node> _list; | 13 final List<Node> _list; |
14 | 14 |
15 _WrappedList(this._list); | 15 _WrappedList(this._list); |
16 | 16 |
17 // Iterable APIs | 17 // Iterable APIs |
18 | 18 |
19 Iterator<E> get iterator => new _WrappedIterator(_list.iterator); | 19 Iterator<E> get iterator => new _WrappedIterator<E>(_list.iterator); |
20 | 20 |
21 int get length => _list.length; | 21 int get length => _list.length; |
22 | 22 |
23 // Collection APIs | 23 // Collection APIs |
24 | 24 |
25 void add(E element) { _list.add(element); } | 25 void add(E element) { _list.add(element); } |
26 | 26 |
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(); } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 bool moveNext() { | 74 bool moveNext() { |
75 return _iterator.moveNext(); | 75 return _iterator.moveNext(); |
76 } | 76 } |
77 | 77 |
78 E get current => _downcast/*<Node, E>*/(_iterator.current); | 78 E get current => _downcast/*<Node, E>*/(_iterator.current); |
79 } | 79 } |
80 | 80 |
81 // ignore: STRONG_MODE_DOWN_CAST_COMPOSITE | 81 // ignore: STRONG_MODE_DOWN_CAST_COMPOSITE |
82 /*=To*/ _downcast/*<From, To extends From>*/(dynamic /*=From*/ x) => x; | 82 /*=To*/ _downcast/*<From, To extends From>*/(dynamic /*=From*/ x) => x; |
OLD | NEW |