@@ -21,6 +21,11 @@ abstract class _TypeSafeIterableBase<E> implements Iterable<E> {
2121
2222 bool any (bool test (E element)) => _base.any (_validate (test));
2323
24+ // TODO: Dart 2.0 requires this method to be implemented.
25+ Iterable <T > cast <T >() {
26+ throw new UnimplementedError ('cast' );
27+ }
28+
2429 bool contains (Object element) => _base.contains (element);
2530
2631 E elementAt (int index) => _base.elementAt (index) as E ;
@@ -38,6 +43,11 @@ abstract class _TypeSafeIterableBase<E> implements Iterable<E> {
3843 _base.fold (initialValue,
3944 (previousValue, element) => combine (previousValue, element as E ));
4045
46+ // TODO: Dart 2.0 requires this method to be implemented.
47+ Iterable <E > followedBy (Iterable <E > other) {
48+ throw new UnimplementedError ('followedBy' );
49+ }
50+
4151 void forEach (void f (E element)) => _base.forEach (_validate (f));
4252
4353 bool get isEmpty => _base.isEmpty;
@@ -60,10 +70,17 @@ abstract class _TypeSafeIterableBase<E> implements Iterable<E> {
6070 E reduce (E combine (E value, E element)) =>
6171 _base.reduce ((value, element) => combine (value as E , element as E )) as E ;
6272
73+ // TODO: Dart 2.0 requires this method to be implemented.
74+ Iterable <T > retype <T >() {
75+ throw new UnimplementedError ('retype' );
76+ }
77+
6378 E get single => _base.single as E ;
6479
65- E singleWhere (bool test (E element)) =>
66- _base.singleWhere (_validate (test)) as E ;
80+ E singleWhere (bool test (E element), {E orElse ()}) {
81+ if (orElse != null ) throw new UnimplementedError ('singleWhere:orElse' );
82+ return _base.singleWhere (_validate (test)) as E ;
83+ }
6784
6885 Iterable <E > skip (int n) => new TypeSafeIterable <E >(_base.skip (n));
6986
@@ -83,6 +100,11 @@ abstract class _TypeSafeIterableBase<E> implements Iterable<E> {
83100 Iterable <E > where (bool test (E element)) =>
84101 new TypeSafeIterable <E >(_base.where (_validate (test)));
85102
103+ // TODO: Dart 2.0 requires this method to be implemented.
104+ Iterable <T > whereType <T >() {
105+ throw new UnimplementedError ('whereType' );
106+ }
107+
86108 String toString () => _base.toString ();
87109
88110 /// Returns a version of [function] that asserts that its argument is an
@@ -116,6 +138,11 @@ class TypeSafeList<E> extends TypeSafeIterable<E> implements DelegatingList<E> {
116138 _listBase[index] = value;
117139 }
118140
141+ // TODO: Dart 2.0 requires this method to be implemented.
142+ List <E > operator + (List <E > other) {
143+ throw new UnimplementedError ('+' );
144+ }
145+
119146 void add (E value) {
120147 _listBase.add (value);
121148 }
@@ -126,6 +153,11 @@ class TypeSafeList<E> extends TypeSafeIterable<E> implements DelegatingList<E> {
126153
127154 Map <int , E > asMap () => new TypeSafeMap <int , E >(_listBase.asMap ());
128155
156+ // TODO: Dart 2.0 requires this method to be implemented.
157+ List <T > cast <T >() {
158+ throw new UnimplementedError ('cast' );
159+ }
160+
129161 void clear () {
130162 _listBase.clear ();
131163 }
@@ -134,11 +166,22 @@ class TypeSafeList<E> extends TypeSafeIterable<E> implements DelegatingList<E> {
134166 _listBase.fillRange (start, end, fillValue);
135167 }
136168
169+ // TODO: Dart 2.0 requires this method to be implemented.
170+ set first (E value) {
171+ if (this .isEmpty) throw new RangeError .index (0 , this );
172+ this [0 ] = value;
173+ }
174+
137175 Iterable <E > getRange (int start, int end) =>
138176 new TypeSafeIterable <E >(_listBase.getRange (start, end));
139177
140178 int indexOf (E element, [int start = 0 ]) => _listBase.indexOf (element, start);
141179
180+ // TODO: Dart 2.0 requires this method to be implemented.
181+ int indexWhere (bool test (E element), [int start = 0 ]) {
182+ throw new UnimplementedError ('indexWhere' );
183+ }
184+
142185 void insert (int index, E element) {
143186 _listBase.insert (index, element);
144187 }
@@ -147,9 +190,20 @@ class TypeSafeList<E> extends TypeSafeIterable<E> implements DelegatingList<E> {
147190 _listBase.insertAll (index, iterable);
148191 }
149192
193+ // TODO: Dart 2.0 requires this method to be implemented.
194+ set last (E value) {
195+ if (this .isEmpty) throw new RangeError .index (0 , this );
196+ this [this .length - 1 ] = value;
197+ }
198+
150199 int lastIndexOf (E element, [int start]) =>
151200 _listBase.lastIndexOf (element, start);
152201
202+ // TODO: Dart 2.0 requires this method to be implemented.
203+ int lastIndexWhere (bool test (E element), [int start]) {
204+ throw new UnimplementedError ('lastIndexWhere' );
205+ }
206+
153207 set length (int newLength) {
154208 _listBase.length = newLength;
155209 }
@@ -176,6 +230,11 @@ class TypeSafeList<E> extends TypeSafeIterable<E> implements DelegatingList<E> {
176230 _listBase.retainWhere (_validate (test));
177231 }
178232
233+ // TODO: Dart 2.0 requires this method to be implemented.
234+ List <T > retype <T >() {
235+ throw new UnimplementedError ('retype' );
236+ }
237+
179238 Iterable <E > get reversed => new TypeSafeIterable <E >(_listBase.reversed);
180239
181240 void setAll (int index, Iterable <E > iterable) {
@@ -217,6 +276,11 @@ class TypeSafeSet<E> extends TypeSafeIterable<E> implements DelegatingSet<E> {
217276 _setBase.addAll (elements);
218277 }
219278
279+ // TODO: Dart 2.0 requires this method to be implemented.
280+ Set <T > cast <T >() {
281+ throw new UnimplementedError ('cast' );
282+ }
283+
220284 void clear () {
221285 _setBase.clear ();
222286 }
@@ -249,6 +313,11 @@ class TypeSafeSet<E> extends TypeSafeIterable<E> implements DelegatingSet<E> {
249313 _setBase.retainWhere (_validate (test));
250314 }
251315
316+ // TODO: Dart 2.0 requires this method to be implemented.
317+ Set <T > retype <T >() {
318+ throw new UnimplementedError ('retype' );
319+ }
320+
252321 Set <E > union (Set <E > other) => new TypeSafeSet <E >(_setBase.union (other));
253322}
254323
@@ -278,6 +347,11 @@ class TypeSafeQueue<E> extends TypeSafeIterable<E>
278347 _baseQueue.addLast (value);
279348 }
280349
350+ // TODO: Dart 2.0 requires this method to be implemented.
351+ Queue <T > cast <T >() {
352+ throw new UnimplementedError ('cast' );
353+ }
354+
281355 void clear () {
282356 _baseQueue.clear ();
283357 }
@@ -292,6 +366,11 @@ class TypeSafeQueue<E> extends TypeSafeIterable<E>
292366 _baseQueue.retainWhere (_validate (test));
293367 }
294368
369+ // TODO: Dart 2.0 requires this method to be implemented.
370+ Queue <T > retype <T >() {
371+ throw new UnimplementedError ('retype' );
372+ }
373+
295374 E removeFirst () => _baseQueue.removeFirst () as E ;
296375
297376 E removeLast () => _baseQueue.removeLast () as E ;
@@ -316,6 +395,18 @@ class TypeSafeMap<K, V> implements DelegatingMap<K, V> {
316395 _base.addAll (other);
317396 }
318397
398+ // TODO: Dart 2.0 requires this method to be implemented.
399+ void addEntries (Iterable <Object > entries) {
400+ // Change Iterable<Object> to Iterable<MapEntry<K, V>> when
401+ // the MapEntry class has been added.
402+ throw new UnimplementedError ('addEntries' );
403+ }
404+
405+ // TODO: Dart 2.0 requires this method to be implemented.
406+ Map <K2 , V2 > cast <K2 , V2 >() {
407+ throw new UnimplementedError ('cast' );
408+ }
409+
319410 void clear () {
320411 _base.clear ();
321412 }
@@ -324,6 +415,13 @@ class TypeSafeMap<K, V> implements DelegatingMap<K, V> {
324415
325416 bool containsValue (Object value) => _base.containsValue (value);
326417
418+ // TODO: Dart 2.0 requires this method to be implemented.
419+ Iterable <Null > get entries {
420+ // Change Iterable<Null> to Iterable<MapEntry<K, V>> when
421+ // the MapEntry class has been added.
422+ throw new UnimplementedError ('entries' );
423+ }
424+
327425 void forEach (void f (K key, V value)) {
328426 _base.forEach ((key, value) => f (key as K , value as V ));
329427 }
@@ -336,11 +434,38 @@ class TypeSafeMap<K, V> implements DelegatingMap<K, V> {
336434
337435 int get length => _base.length;
338436
437+ // TODO: Dart 2.0 requires this method to be implemented.
438+ Map <K2 , V2 > map <K2 , V2 >(Object transform (K key, V value)) {
439+ // Change Object to MapEntry<K2, V2> when
440+ // the MapEntry class has been added.
441+ throw new UnimplementedError ('map' );
442+ }
443+
339444 V putIfAbsent (K key, V ifAbsent ()) => _base.putIfAbsent (key, ifAbsent) as V ;
340445
341446 V remove (Object key) => _base.remove (key) as V ;
342447
448+ // TODO: Dart 2.0 requires this method to be implemented.
449+ void removeWhere (bool test (K key, V value)) {
450+ throw new UnimplementedError ('removeWhere' );
451+ }
452+
453+ // TODO: Dart 2.0 requires this method to be implemented.
454+ Map <K2 , V2 > retype <K2 , V2 >() {
455+ throw new UnimplementedError ('retype' );
456+ }
457+
343458 Iterable <V > get values => new TypeSafeIterable <V >(_base.values);
344459
345460 String toString () => _base.toString ();
461+
462+ // TODO: Dart 2.0 requires this method to be implemented.
463+ V update (K key, V update (V value), {V ifAbsent ()}) {
464+ throw new UnimplementedError ('update' );
465+ }
466+
467+ // TODO: Dart 2.0 requires this method to be implemented.
468+ void updateAll (V update (K key, V value)) {
469+ throw new UnimplementedError ('updateAll' );
470+ }
346471}
0 commit comments