OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 dart2js.util; | 5 library compiler_util.link; |
| 6 |
| 7 import 'src/link_implementation.dart' show |
| 8 LinkBuilderImplementation, |
| 9 LinkEntry, |
| 10 LinkIterator, |
| 11 MappedLinkIterable; |
6 | 12 |
7 class Link<T> implements Iterable<T> { | 13 class Link<T> implements Iterable<T> { |
8 T get head => throw new StateError("no elements"); | 14 T get head => throw new StateError("no elements"); |
9 Link<T> get tail => null; | 15 Link<T> get tail => null; |
10 | 16 |
11 const Link(); | 17 const Link(); |
12 | 18 |
13 Link<T> prepend(T element) { | 19 Link<T> prepend(T element) { |
14 return new LinkEntry<T>(element, this); | 20 return new LinkEntry<T>(element, this); |
15 } | 21 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 169 |
164 /// Returns the number of elements in the list being built. | 170 /// Returns the number of elements in the list being built. |
165 final int length; | 171 final int length; |
166 | 172 |
167 /// Returns `true` if the list being built is empty. | 173 /// Returns `true` if the list being built is empty. |
168 final bool isEmpty; | 174 final bool isEmpty; |
169 | 175 |
170 /// Removes all added elements and resets the builder. | 176 /// Removes all added elements and resets the builder. |
171 void clear(); | 177 void clear(); |
172 } | 178 } |
OLD | NEW |