OLD | NEW |
1 part of dart._internal; | 1 part of dart._internal; |
2 abstract class EfficientLength {int get length; | 2 abstract class EfficientLength {int get length; |
3 } | 3 } |
4 abstract class ListIterable<E> extends IterableBase<E> implements EfficientLeng
th {int get length; | 4 abstract class ListIterable<E> extends IterableBase<E> implements EfficientLeng
th {int get length; |
5 E elementAt(int i); | 5 E elementAt(int i); |
6 const ListIterable(); | 6 const ListIterable(); |
7 Iterator<E> get iterator => new ListIterator<E>(this); | 7 Iterator<E> get iterator => new ListIterator<E>(this); |
8 void forEach(void action(E element)) { | 8 void forEach(void action(E element)) { |
9 int length = this.length; | 9 int length = this.length; |
10 for (int i = 0; i < length; i++) { | 10 for (int i = 0; i < length; i++) { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 } | 347 } |
348 } | 348 } |
349 return false; | 349 return false; |
350 } | 350 } |
351 E get current => _iterator.current; | 351 E get current => _iterator.current; |
352 } | 352 } |
353 typedef Iterable<T> _ExpandFunction<S, T>(S sourceElement); | 353 typedef Iterable<T> _ExpandFunction<S, T>(S sourceElement); |
354 class ExpandIterable<S, T> extends IterableBase<T> {final Iterable<S> _iterable
; | 354 class ExpandIterable<S, T> extends IterableBase<T> {final Iterable<S> _iterable
; |
355 final _ExpandFunction _f; | 355 final _ExpandFunction _f; |
356 ExpandIterable(this._iterable, Iterable<T> this._f(S element)); | 356 ExpandIterable(this._iterable, Iterable<T> this._f(S element)); |
357 Iterator<T> get iterator => new ExpandIterator<S, T>(_iterable.iterator, DEVC$R
T.cast(_f, null, DEVC$RT.type((__t0<S, T> _) { | 357 Iterator<T> get iterator => new ExpandIterator<S, T>(_iterable.iterator, DEVC$R
T.cast(_f, null, DEVC$RT.type((__CastType0<S, T> _) { |
358 } | 358 } |
359 ), "CompositeCast", """line 454, column 76 of dart:_internal/iterable.dart: """,
_f is __t0<S, T>, false)); | 359 ), "CompositeCast", """line 454, column 76 of dart:_internal/iterable.dart: """,
_f is __CastType0<S, T>, false)); |
360 } | 360 } |
361 class ExpandIterator<S, T> implements Iterator<T> {final Iterator<S> _iterator; | 361 class ExpandIterator<S, T> implements Iterator<T> {final Iterator<S> _iterator; |
362 final _ExpandFunction _f; | 362 final _ExpandFunction _f; |
363 Iterator<T> _currentExpansion = const EmptyIterator<T>(); | 363 Iterator<T> _currentExpansion = const EmptyIterator<T>(); |
364 T _current; | 364 T _current; |
365 ExpandIterator(this._iterator, Iterable<T> this._f(S element)); | 365 ExpandIterator(this._iterator, Iterable<T> this._f(S element)); |
366 void _nextExpansion() { | 366 void _nextExpansion() { |
367 } | 367 } |
368 T get current => _current; | 368 T get current => _current; |
369 bool moveNext() { | 369 bool moveNext() { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 } | 423 } |
424 E get current { | 424 E get current { |
425 if (_remaining < 0) return null; | 425 if (_remaining < 0) return null; |
426 return _iterator.current; | 426 return _iterator.current; |
427 } | 427 } |
428 } | 428 } |
429 class TakeWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable
; | 429 class TakeWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable
; |
430 final _ElementPredicate _f; | 430 final _ElementPredicate _f; |
431 TakeWhileIterable(this._iterable, bool this._f(E element)); | 431 TakeWhileIterable(this._iterable, bool this._f(E element)); |
432 Iterator<E> get iterator { | 432 Iterator<E> get iterator { |
433 return new TakeWhileIterator<E>(_iterable.iterator, DEVC$RT.cast(_f, null, DEVC$
RT.type((__t3<E> _) { | 433 return new TakeWhileIterator<E>(_iterable.iterator, DEVC$RT.cast(_f, null, DEVC$
RT.type((__CastType3<E> _) { |
434 } | 434 } |
435 ), "CompositeCast", """line 555, column 57 of dart:_internal/iterable.dart: """,
_f is __t3<E>, false)); | 435 ), "CompositeCast", """line 555, column 57 of dart:_internal/iterable.dart: """,
_f is __CastType3<E>, false)); |
436 } | 436 } |
437 } | 437 } |
438 class TakeWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator; | 438 class TakeWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator; |
439 final _ElementPredicate _f; | 439 final _ElementPredicate _f; |
440 bool _isFinished = false; | 440 bool _isFinished = false; |
441 TakeWhileIterator(this._iterator, bool this._f(E element)); | 441 TakeWhileIterator(this._iterator, bool this._f(E element)); |
442 bool moveNext() { | 442 bool moveNext() { |
443 if (_isFinished) return false; | 443 if (_isFinished) return false; |
444 if (!_iterator.moveNext() || !_f(_iterator.current)) { | 444 if (!_iterator.moveNext() || !_f(_iterator.current)) { |
445 _isFinished = true; | 445 _isFinished = true; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 for (int i = 0; i < _skipCount; i++) _iterator.moveNext(); | 492 for (int i = 0; i < _skipCount; i++) _iterator.moveNext(); |
493 _skipCount = 0; | 493 _skipCount = 0; |
494 return _iterator.moveNext(); | 494 return _iterator.moveNext(); |
495 } | 495 } |
496 E get current => _iterator.current; | 496 E get current => _iterator.current; |
497 } | 497 } |
498 class SkipWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable
; | 498 class SkipWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable
; |
499 final _ElementPredicate _f; | 499 final _ElementPredicate _f; |
500 SkipWhileIterable(this._iterable, bool this._f(E element)); | 500 SkipWhileIterable(this._iterable, bool this._f(E element)); |
501 Iterator<E> get iterator { | 501 Iterator<E> get iterator { |
502 return new SkipWhileIterator<E>(_iterable.iterator, DEVC$RT.cast(_f, null, DEVC$
RT.type((__t5<E> _) { | 502 return new SkipWhileIterator<E>(_iterable.iterator, DEVC$RT.cast(_f, null, DEVC$
RT.type((__CastType5<E> _) { |
503 } | 503 } |
504 ), "CompositeCast", """line 648, column 57 of dart:_internal/iterable.dart: """,
_f is __t5<E>, false)); | 504 ), "CompositeCast", """line 648, column 57 of dart:_internal/iterable.dart: """,
_f is __CastType5<E>, false)); |
505 } | 505 } |
506 } | 506 } |
507 class SkipWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator; | 507 class SkipWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator; |
508 final _ElementPredicate _f; | 508 final _ElementPredicate _f; |
509 bool _hasSkipped = false; | 509 bool _hasSkipped = false; |
510 SkipWhileIterator(this._iterator, bool this._f(E element)); | 510 SkipWhileIterator(this._iterator, bool this._f(E element)); |
511 bool moveNext() { | 511 bool moveNext() { |
512 if (!_hasSkipped) { | 512 if (!_hasSkipped) { |
513 _hasSkipped = true; | 513 _hasSkipped = true; |
514 while (_iterator.moveNext()) { | 514 while (_iterator.moveNext()) { |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 buffer.write(list[i]); | 745 buffer.write(list[i]); |
746 } | 746 } |
747 } | 747 } |
748 return buffer.toString(); | 748 return buffer.toString(); |
749 } | 749 } |
750 Iterable<T> where(Iterable iterable, bool f(var element)) { | 750 Iterable<T> where(Iterable iterable, bool f(var element)) { |
751 return new WhereIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dynami
c> _) { | 751 return new WhereIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dynami
c> _) { |
752 } | 752 } |
753 ), DEVC$RT.type((Iterable<T> _) { | 753 ), DEVC$RT.type((Iterable<T> _) { |
754 } | 754 } |
755 ), "CompositeCast", """line 961, column 33 of dart:_internal/iterable.dart: """,
iterable is Iterable<T>, false), DEVC$RT.cast(f, null, DEVC$RT.type((__t7<T> _)
{ | 755 ), "CompositeCast", """line 961, column 33 of dart:_internal/iterable.dart: """,
iterable is Iterable<T>, false), DEVC$RT.cast(f, null, DEVC$RT.type((__CastType
7<T> _) { |
756 } | 756 } |
757 ), "CompositeCast", """line 961, column 43 of dart:_internal/iterable.dart: """,
f is __t7<T>, false)); | 757 ), "CompositeCast", """line 961, column 43 of dart:_internal/iterable.dart: """,
f is __CastType7<T>, false)); |
758 } | 758 } |
759 static Iterable map(Iterable iterable, f(var element)) { | 759 static Iterable map(Iterable iterable, f(var element)) { |
760 return new MappedIterable(iterable, f); | 760 return new MappedIterable(iterable, f); |
761 } | 761 } |
762 static Iterable mapList(List list, f(var element)) { | 762 static Iterable mapList(List list, f(var element)) { |
763 return new MappedListIterable(list, f); | 763 return new MappedListIterable(list, f); |
764 } | 764 } |
765 static Iterable expand(Iterable iterable, Iterable f(var element)) { | 765 static Iterable expand(Iterable iterable, Iterable f(var element)) { |
766 return new ExpandIterable(iterable, f); | 766 return new ExpandIterable(iterable, f); |
767 } | 767 } |
768 Iterable<T> takeList(List list, int n) { | 768 Iterable<T> takeList(List list, int n) { |
769 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _)
{ | 769 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _)
{ |
770 } | 770 } |
771 ), DEVC$RT.type((Iterable<T> _) { | 771 ), DEVC$RT.type((Iterable<T> _) { |
772 } | 772 } |
773 ), "CompositeCast", """line 978, column 35 of dart:_internal/iterable.dart: """,
list is Iterable<T>, false), 0, n); | 773 ), "CompositeCast", """line 978, column 35 of dart:_internal/iterable.dart: """,
list is Iterable<T>, false), 0, n); |
774 } | 774 } |
775 Iterable<T> takeWhile(Iterable iterable, bool test(var value)) { | 775 Iterable<T> takeWhile(Iterable iterable, bool test(var value)) { |
776 return new TakeWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy
namic> _) { | 776 return new TakeWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy
namic> _) { |
777 } | 777 } |
778 ), DEVC$RT.type((Iterable<T> _) { | 778 ), DEVC$RT.type((Iterable<T> _) { |
779 } | 779 } |
780 ), "CompositeCast", """line 983, column 37 of dart:_internal/iterable.dart: """,
iterable is Iterable<T>, false), DEVC$RT.cast(test, null, DEVC$RT.type((__t7<T>
_) { | 780 ), "CompositeCast", """line 983, column 37 of dart:_internal/iterable.dart: """,
iterable is Iterable<T>, false), DEVC$RT.cast(test, null, DEVC$RT.type((__CastT
ype7<T> _) { |
781 } | 781 } |
782 ), "CompositeCast", """line 983, column 47 of dart:_internal/iterable.dart: """,
test is __t7<T>, false)); | 782 ), "CompositeCast", """line 983, column 47 of dart:_internal/iterable.dart: """,
test is __CastType7<T>, false)); |
783 } | 783 } |
784 Iterable<T> skipList(List list, int n) { | 784 Iterable<T> skipList(List list, int n) { |
785 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _)
{ | 785 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _)
{ |
786 } | 786 } |
787 ), DEVC$RT.type((Iterable<T> _) { | 787 ), DEVC$RT.type((Iterable<T> _) { |
788 } | 788 } |
789 ), "CompositeCast", """line 988, column 35 of dart:_internal/iterable.dart: """,
list is Iterable<T>, false), n, null); | 789 ), "CompositeCast", """line 988, column 35 of dart:_internal/iterable.dart: """,
list is Iterable<T>, false), n, null); |
790 } | 790 } |
791 Iterable<T> skipWhile(Iterable iterable, bool test(var value)) { | 791 Iterable<T> skipWhile(Iterable iterable, bool test(var value)) { |
792 return new SkipWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy
namic> _) { | 792 return new SkipWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy
namic> _) { |
793 } | 793 } |
794 ), DEVC$RT.type((Iterable<T> _) { | 794 ), DEVC$RT.type((Iterable<T> _) { |
795 } | 795 } |
796 ), "CompositeCast", """line 993, column 37 of dart:_internal/iterable.dart: """,
iterable is Iterable<T>, false), DEVC$RT.cast(test, null, DEVC$RT.type((__t7<T>
_) { | 796 ), "CompositeCast", """line 993, column 37 of dart:_internal/iterable.dart: """,
iterable is Iterable<T>, false), DEVC$RT.cast(test, null, DEVC$RT.type((__CastT
ype7<T> _) { |
797 } | 797 } |
798 ), "CompositeCast", """line 993, column 47 of dart:_internal/iterable.dart: """,
test is __t7<T>, false)); | 798 ), "CompositeCast", """line 993, column 47 of dart:_internal/iterable.dart: """,
test is __CastType7<T>, false)); |
799 } | 799 } |
800 Iterable<T> reversedList(List list) { | 800 Iterable<T> reversedList(List list) { |
801 return new ReversedListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic
> _) { | 801 return new ReversedListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic
> _) { |
802 } | 802 } |
803 ), DEVC$RT.type((Iterable<T> _) { | 803 ), DEVC$RT.type((Iterable<T> _) { |
804 } | 804 } |
805 ), "CompositeCast", """line 997, column 40 of dart:_internal/iterable.dart: """,
list is Iterable<T>, false)); | 805 ), "CompositeCast", """line 997, column 40 of dart:_internal/iterable.dart: """,
list is Iterable<T>, false)); |
806 } | 806 } |
807 static void sortList(List list, int compare(a, b)) { | 807 static void sortList(List list, int compare(a, b)) { |
808 if (compare == null) compare = Comparable.compare; | 808 if (compare == null) compare = Comparable.compare; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 result.add(element); | 948 result.add(element); |
949 } | 949 } |
950 } | 950 } |
951 return result; | 951 return result; |
952 } | 952 } |
953 } | 953 } |
954 abstract class IterableElementError {static StateError noElement() => new State
Error("No element"); | 954 abstract class IterableElementError {static StateError noElement() => new State
Error("No element"); |
955 static StateError tooMany() => new StateError("Too many elements"); | 955 static StateError tooMany() => new StateError("Too many elements"); |
956 static StateError tooFew() => new StateError("Too few elements"); | 956 static StateError tooFew() => new StateError("Too few elements"); |
957 } | 957 } |
958 typedef Iterable<T> __t0<S, T>(S __u1); | 958 typedef Iterable<T> __CastType0<S, T>(S __u1); |
959 typedef bool __t3<E>(E __u4); | 959 typedef bool __CastType3<E>(E __u4); |
960 typedef bool __t5<E>(E __u6); | 960 typedef bool __CastType5<E>(E __u6); |
961 typedef bool __t7<T>(T __u8); | 961 typedef bool __CastType7<T>(T __u8); |
962 typedef bool __t9(dynamic __u10); | 962 typedef bool __CastType9(dynamic __u10); |
OLD | NEW |