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 library fasta.util.link; | 5 library fasta.util.link; |
6 | 6 |
7 import 'link_implementation.dart' show | 7 import 'link_implementation.dart' |
8 LinkBuilderImplementation, | 8 show LinkBuilderImplementation, LinkEntry, LinkIterator, MappedLinkIterable; |
9 LinkEntry, | |
10 LinkIterator, | |
11 MappedLinkIterable; | |
12 | 9 |
13 class Link<T> implements Iterable<T> { | 10 class Link<T> implements Iterable<T> { |
14 T get head => throw new StateError("no elements"); | 11 T get head => throw new StateError("no elements"); |
15 Link<T> get tail => null; | 12 Link<T> get tail => null; |
16 | 13 |
17 const Link(); | 14 const Link(); |
18 | 15 |
19 Link<T> prepend(T element) { | 16 Link<T> prepend(T element) { |
20 return new LinkEntry<T>(element, this); | 17 return new LinkEntry<T>(element, this); |
21 } | 18 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // | 126 // |
130 // Unsupported Iterable<T> methods. | 127 // Unsupported Iterable<T> methods. |
131 // | 128 // |
132 bool any(bool f(T e)) => _unsupported('any'); | 129 bool any(bool f(T e)) => _unsupported('any'); |
133 T elementAt(int i) => _unsupported('elementAt'); | 130 T elementAt(int i) => _unsupported('elementAt'); |
134 Iterable<K> expand<K>(Iterable<K> f(T e)) => _unsupported('expand'); | 131 Iterable<K> expand<K>(Iterable<K> f(T e)) => _unsupported('expand'); |
135 T firstWhere(bool f(T e), {T orElse()}) => _unsupported('firstWhere'); | 132 T firstWhere(bool f(T e), {T orElse()}) => _unsupported('firstWhere'); |
136 K fold<K>(K initialValue, K combine(K value, T element)) { | 133 K fold<K>(K initialValue, K combine(K value, T element)) { |
137 return _unsupported('fold'); | 134 return _unsupported('fold'); |
138 } | 135 } |
| 136 |
139 T get last => _unsupported('get:last'); | 137 T get last => _unsupported('get:last'); |
140 T lastWhere(bool f(T e), {T orElse()}) => _unsupported('lastWhere'); | 138 T lastWhere(bool f(T e), {T orElse()}) => _unsupported('lastWhere'); |
141 String join([separator = '']) => _unsupported('join'); | 139 String join([separator = '']) => _unsupported('join'); |
142 T reduce(T combine(T a, T b)) => _unsupported('reduce'); | 140 T reduce(T combine(T a, T b)) => _unsupported('reduce'); |
143 T singleWhere(bool f(T e)) => _unsupported('singleWhere'); | 141 T singleWhere(bool f(T e)) => _unsupported('singleWhere'); |
144 Iterable<T> skipWhile(bool f(T e)) => _unsupported('skipWhile'); | 142 Iterable<T> skipWhile(bool f(T e)) => _unsupported('skipWhile'); |
145 Iterable<T> take(int n) => _unsupported('take'); | 143 Iterable<T> take(int n) => _unsupported('take'); |
146 Iterable<T> takeWhile(bool f(T e)) => _unsupported('takeWhile'); | 144 Iterable<T> takeWhile(bool f(T e)) => _unsupported('takeWhile'); |
147 Set<T> toSet() => _unsupported('toSet'); | 145 Set<T> toSet() => _unsupported('toSet'); |
148 Iterable<T> where(bool f(T e)) => _unsupported('where'); | 146 Iterable<T> where(bool f(T e)) => _unsupported('where'); |
(...skipping 22 matching lines...) Expand all Loading... |
171 | 169 |
172 /// Returns the number of elements in the list being built. | 170 /// Returns the number of elements in the list being built. |
173 final int length; | 171 final int length; |
174 | 172 |
175 /// Returns `true` if the list being built is empty. | 173 /// Returns `true` if the list being built is empty. |
176 final bool isEmpty; | 174 final bool isEmpty; |
177 | 175 |
178 /// Removes all added elements and resets the builder. | 176 /// Removes all added elements and resets the builder. |
179 void clear(); | 177 void clear(); |
180 } | 178 } |
OLD | NEW |