Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: sdk/lib/svg/dartium/svg_dartium.dart

Issue 11956039: Revert "Create IterableMixinWorkaround and move most of the Collections methods there." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/svg/dart2js/svg_dart2js.dart ('k') | tests/corelib/iterable_min_max_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library svg; 1 library svg;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'dart:html'; 5 import 'dart:html';
6 import 'dart:html_common'; 6 import 'dart:html_common';
7 import 'dart:nativewrappers'; 7 import 'dart:nativewrappers';
8 // DO NOT EDIT 8 // DO NOT EDIT
9 // Auto-generated dart:svg library. 9 // Auto-generated dart:svg library.
10 10
(...skipping 3773 matching lines...) Expand 10 before | Expand all | Expand 10 after
3784 Iterator<Length> get iterator { 3784 Iterator<Length> get iterator {
3785 // Note: NodeLists are not fixed size. And most probably length shouldn't 3785 // Note: NodeLists are not fixed size. And most probably length shouldn't
3786 // be cached in both iterator _and_ forEach method. For now caching it 3786 // be cached in both iterator _and_ forEach method. For now caching it
3787 // for consistency. 3787 // for consistency.
3788 return new FixedSizeListIterator<Length>(this); 3788 return new FixedSizeListIterator<Length>(this);
3789 } 3789 }
3790 3790
3791 // SVG Collections expose numberOfItems rather than length. 3791 // SVG Collections expose numberOfItems rather than length.
3792 int get length => numberOfItems; 3792 int get length => numberOfItems;
3793 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Length)) { 3793 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Length)) {
3794 return IterableMixinWorkaround.reduce(this, initialValue, combine); 3794 return Collections.reduce(this, initialValue, combine);
3795 } 3795 }
3796 3796
3797 bool contains(Length element) => IterableMixinWorkaround.contains(this, elemen t); 3797 bool contains(Length element) => Collections.contains(this, element);
3798 3798
3799 void forEach(void f(Length element)) => IterableMixinWorkaround.forEach(this, f); 3799 void forEach(void f(Length element)) => Collections.forEach(this, f);
3800 3800
3801 String join([String separator]) => IterableMixinWorkaround.joinList(this, sepa rator); 3801 String join([String separator]) => Collections.joinList(this, separator);
3802 3802
3803 List mappedBy(f(Length element)) => IterableMixinWorkaround.mappedByList(this, f); 3803 List mappedBy(f(Length element)) => new MappedList<Length, dynamic>(this, f);
3804 3804
3805 Iterable<Length> where(bool f(Length element)) => IterableMixinWorkaround.wher e(this, f); 3805 Iterable<Length> where(bool f(Length element)) => new WhereIterable<Length>(th is, f);
3806 3806
3807 bool every(bool f(Length element)) => IterableMixinWorkaround.every(this, f); 3807 bool every(bool f(Length element)) => Collections.every(this, f);
3808 3808
3809 bool any(bool f(Length element)) => IterableMixinWorkaround.any(this, f); 3809 bool any(bool f(Length element)) => Collections.any(this, f);
3810 3810
3811 List<Length> toList() => new List<Length>.from(this); 3811 List<Length> toList() => new List<Length>.from(this);
3812 Set<Length> toSet() => new Set<Length>.from(this); 3812 Set<Length> toSet() => new Set<Length>.from(this);
3813 3813
3814 bool get isEmpty => this.length == 0; 3814 bool get isEmpty => this.length == 0;
3815 3815
3816 List<Length> take(int n) => IterableMixinWorkaround.takeList(this, n); 3816 List<Length> take(int n) => new ListView<Length>(this, 0, n);
3817 3817
3818 Iterable<Length> takeWhile(bool test(Length value)) { 3818 Iterable<Length> takeWhile(bool test(Length value)) {
3819 return IterableMixinWorkaround.takeWhile(this, test); 3819 return new TakeWhileIterable<Length>(this, test);
3820 } 3820 }
3821 3821
3822 List<Length> skip(int n) => IterableMixinWorkaround.skipList(this, n); 3822 List<Length> skip(int n) => new ListView<Length>(this, n, null);
3823 3823
3824 Iterable<Length> skipWhile(bool test(Length value)) { 3824 Iterable<Length> skipWhile(bool test(Length value)) {
3825 return IterableMixinWorkaround.skipWhile(this, test); 3825 return new SkipWhileIterable<Length>(this, test);
3826 } 3826 }
3827 3827
3828 Length firstMatching(bool test(Length value), { Length orElse() }) { 3828 Length firstMatching(bool test(Length value), { Length orElse() }) {
3829 return IterableMixinWorkaround.firstMatching(this, test, orElse); 3829 return Collections.firstMatching(this, test, orElse);
3830 } 3830 }
3831 3831
3832 Length lastMatching(bool test(Length value), {Length orElse()}) { 3832 Length lastMatching(bool test(Length value), {Length orElse()}) {
3833 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); 3833 return Collections.lastMatchingInList(this, test, orElse);
3834 } 3834 }
3835 3835
3836 Length singleMatching(bool test(Length value)) { 3836 Length singleMatching(bool test(Length value)) {
3837 return IterableMixinWorkaround.singleMatching(this, test); 3837 return Collections.singleMatching(this, test);
3838 } 3838 }
3839 3839
3840 Length elementAt(int index) { 3840 Length elementAt(int index) {
3841 return this[index]; 3841 return this[index];
3842 } 3842 }
3843 3843
3844 // From Collection<Length>: 3844 // From Collection<Length>:
3845 3845
3846 void add(Length value) { 3846 void add(Length value) {
3847 throw new UnsupportedError("Cannot add to immutable List."); 3847 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3883 if (this.length > 0) return this[this.length - 1]; 3883 if (this.length > 0) return this[this.length - 1];
3884 throw new StateError("No elements"); 3884 throw new StateError("No elements");
3885 } 3885 }
3886 3886
3887 Length get single { 3887 Length get single {
3888 if (length == 1) return this[0]; 3888 if (length == 1) return this[0];
3889 if (length == 0) throw new StateError("No elements"); 3889 if (length == 0) throw new StateError("No elements");
3890 throw new StateError("More than one element"); 3890 throw new StateError("More than one element");
3891 } 3891 }
3892 3892
3893 Length min([int compare(Length a, Length b)]) => IterableMixinWorkaround.min(t his, compare); 3893 Length min([int compare(Length a, Length b)]) => Collections.min(this, compare );
3894 3894
3895 Length max([int compare(Length a, Length b)]) => IterableMixinWorkaround.max(t his, compare); 3895 Length max([int compare(Length a, Length b)]) => Collections.max(this, compare );
3896 3896
3897 Length removeAt(int pos) { 3897 Length removeAt(int pos) {
3898 throw new UnsupportedError("Cannot removeAt on immutable List."); 3898 throw new UnsupportedError("Cannot removeAt on immutable List.");
3899 } 3899 }
3900 3900
3901 Length removeLast() { 3901 Length removeLast() {
3902 throw new UnsupportedError("Cannot removeLast on immutable List."); 3902 throw new UnsupportedError("Cannot removeLast on immutable List.");
3903 } 3903 }
3904 3904
3905 void setRange(int start, int rangeLength, List<Length> from, [int startFrom]) { 3905 void setRange(int start, int rangeLength, List<Length> from, [int startFrom]) {
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
4522 Iterator<Number> get iterator { 4522 Iterator<Number> get iterator {
4523 // Note: NodeLists are not fixed size. And most probably length shouldn't 4523 // Note: NodeLists are not fixed size. And most probably length shouldn't
4524 // be cached in both iterator _and_ forEach method. For now caching it 4524 // be cached in both iterator _and_ forEach method. For now caching it
4525 // for consistency. 4525 // for consistency.
4526 return new FixedSizeListIterator<Number>(this); 4526 return new FixedSizeListIterator<Number>(this);
4527 } 4527 }
4528 4528
4529 // SVG Collections expose numberOfItems rather than length. 4529 // SVG Collections expose numberOfItems rather than length.
4530 int get length => numberOfItems; 4530 int get length => numberOfItems;
4531 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Number)) { 4531 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Number)) {
4532 return IterableMixinWorkaround.reduce(this, initialValue, combine); 4532 return Collections.reduce(this, initialValue, combine);
4533 } 4533 }
4534 4534
4535 bool contains(Number element) => IterableMixinWorkaround.contains(this, elemen t); 4535 bool contains(Number element) => Collections.contains(this, element);
4536 4536
4537 void forEach(void f(Number element)) => IterableMixinWorkaround.forEach(this, f); 4537 void forEach(void f(Number element)) => Collections.forEach(this, f);
4538 4538
4539 String join([String separator]) => IterableMixinWorkaround.joinList(this, sepa rator); 4539 String join([String separator]) => Collections.joinList(this, separator);
4540 4540
4541 List mappedBy(f(Number element)) => IterableMixinWorkaround.mappedByList(this, f); 4541 List mappedBy(f(Number element)) => new MappedList<Number, dynamic>(this, f);
4542 4542
4543 Iterable<Number> where(bool f(Number element)) => IterableMixinWorkaround.wher e(this, f); 4543 Iterable<Number> where(bool f(Number element)) => new WhereIterable<Number>(th is, f);
4544 4544
4545 bool every(bool f(Number element)) => IterableMixinWorkaround.every(this, f); 4545 bool every(bool f(Number element)) => Collections.every(this, f);
4546 4546
4547 bool any(bool f(Number element)) => IterableMixinWorkaround.any(this, f); 4547 bool any(bool f(Number element)) => Collections.any(this, f);
4548 4548
4549 List<Number> toList() => new List<Number>.from(this); 4549 List<Number> toList() => new List<Number>.from(this);
4550 Set<Number> toSet() => new Set<Number>.from(this); 4550 Set<Number> toSet() => new Set<Number>.from(this);
4551 4551
4552 bool get isEmpty => this.length == 0; 4552 bool get isEmpty => this.length == 0;
4553 4553
4554 List<Number> take(int n) => IterableMixinWorkaround.takeList(this, n); 4554 List<Number> take(int n) => new ListView<Number>(this, 0, n);
4555 4555
4556 Iterable<Number> takeWhile(bool test(Number value)) { 4556 Iterable<Number> takeWhile(bool test(Number value)) {
4557 return IterableMixinWorkaround.takeWhile(this, test); 4557 return new TakeWhileIterable<Number>(this, test);
4558 } 4558 }
4559 4559
4560 List<Number> skip(int n) => IterableMixinWorkaround.skipList(this, n); 4560 List<Number> skip(int n) => new ListView<Number>(this, n, null);
4561 4561
4562 Iterable<Number> skipWhile(bool test(Number value)) { 4562 Iterable<Number> skipWhile(bool test(Number value)) {
4563 return IterableMixinWorkaround.skipWhile(this, test); 4563 return new SkipWhileIterable<Number>(this, test);
4564 } 4564 }
4565 4565
4566 Number firstMatching(bool test(Number value), { Number orElse() }) { 4566 Number firstMatching(bool test(Number value), { Number orElse() }) {
4567 return IterableMixinWorkaround.firstMatching(this, test, orElse); 4567 return Collections.firstMatching(this, test, orElse);
4568 } 4568 }
4569 4569
4570 Number lastMatching(bool test(Number value), {Number orElse()}) { 4570 Number lastMatching(bool test(Number value), {Number orElse()}) {
4571 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); 4571 return Collections.lastMatchingInList(this, test, orElse);
4572 } 4572 }
4573 4573
4574 Number singleMatching(bool test(Number value)) { 4574 Number singleMatching(bool test(Number value)) {
4575 return IterableMixinWorkaround.singleMatching(this, test); 4575 return Collections.singleMatching(this, test);
4576 } 4576 }
4577 4577
4578 Number elementAt(int index) { 4578 Number elementAt(int index) {
4579 return this[index]; 4579 return this[index];
4580 } 4580 }
4581 4581
4582 // From Collection<Number>: 4582 // From Collection<Number>:
4583 4583
4584 void add(Number value) { 4584 void add(Number value) {
4585 throw new UnsupportedError("Cannot add to immutable List."); 4585 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
4621 if (this.length > 0) return this[this.length - 1]; 4621 if (this.length > 0) return this[this.length - 1];
4622 throw new StateError("No elements"); 4622 throw new StateError("No elements");
4623 } 4623 }
4624 4624
4625 Number get single { 4625 Number get single {
4626 if (length == 1) return this[0]; 4626 if (length == 1) return this[0];
4627 if (length == 0) throw new StateError("No elements"); 4627 if (length == 0) throw new StateError("No elements");
4628 throw new StateError("More than one element"); 4628 throw new StateError("More than one element");
4629 } 4629 }
4630 4630
4631 Number min([int compare(Number a, Number b)]) => IterableMixinWorkaround.min(t his, compare); 4631 Number min([int compare(Number a, Number b)]) => Collections.min(this, compare );
4632 4632
4633 Number max([int compare(Number a, Number b)]) => IterableMixinWorkaround.max(t his, compare); 4633 Number max([int compare(Number a, Number b)]) => Collections.max(this, compare );
4634 4634
4635 Number removeAt(int pos) { 4635 Number removeAt(int pos) {
4636 throw new UnsupportedError("Cannot removeAt on immutable List."); 4636 throw new UnsupportedError("Cannot removeAt on immutable List.");
4637 } 4637 }
4638 4638
4639 Number removeLast() { 4639 Number removeLast() {
4640 throw new UnsupportedError("Cannot removeLast on immutable List."); 4640 throw new UnsupportedError("Cannot removeLast on immutable List.");
4641 } 4641 }
4642 4642
4643 void setRange(int start, int rangeLength, List<Number> from, [int startFrom]) { 4643 void setRange(int start, int rangeLength, List<Number> from, [int startFrom]) {
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
5678 Iterator<PathSeg> get iterator { 5678 Iterator<PathSeg> get iterator {
5679 // Note: NodeLists are not fixed size. And most probably length shouldn't 5679 // Note: NodeLists are not fixed size. And most probably length shouldn't
5680 // be cached in both iterator _and_ forEach method. For now caching it 5680 // be cached in both iterator _and_ forEach method. For now caching it
5681 // for consistency. 5681 // for consistency.
5682 return new FixedSizeListIterator<PathSeg>(this); 5682 return new FixedSizeListIterator<PathSeg>(this);
5683 } 5683 }
5684 5684
5685 // SVG Collections expose numberOfItems rather than length. 5685 // SVG Collections expose numberOfItems rather than length.
5686 int get length => numberOfItems; 5686 int get length => numberOfItems;
5687 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, PathSeg)) { 5687 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, PathSeg)) {
5688 return IterableMixinWorkaround.reduce(this, initialValue, combine); 5688 return Collections.reduce(this, initialValue, combine);
5689 } 5689 }
5690 5690
5691 bool contains(PathSeg element) => IterableMixinWorkaround.contains(this, eleme nt); 5691 bool contains(PathSeg element) => Collections.contains(this, element);
5692 5692
5693 void forEach(void f(PathSeg element)) => IterableMixinWorkaround.forEach(this, f); 5693 void forEach(void f(PathSeg element)) => Collections.forEach(this, f);
5694 5694
5695 String join([String separator]) => IterableMixinWorkaround.joinList(this, sepa rator); 5695 String join([String separator]) => Collections.joinList(this, separator);
5696 5696
5697 List mappedBy(f(PathSeg element)) => IterableMixinWorkaround.mappedByList(this , f); 5697 List mappedBy(f(PathSeg element)) => new MappedList<PathSeg, dynamic>(this, f) ;
5698 5698
5699 Iterable<PathSeg> where(bool f(PathSeg element)) => IterableMixinWorkaround.wh ere(this, f); 5699 Iterable<PathSeg> where(bool f(PathSeg element)) => new WhereIterable<PathSeg> (this, f);
5700 5700
5701 bool every(bool f(PathSeg element)) => IterableMixinWorkaround.every(this, f); 5701 bool every(bool f(PathSeg element)) => Collections.every(this, f);
5702 5702
5703 bool any(bool f(PathSeg element)) => IterableMixinWorkaround.any(this, f); 5703 bool any(bool f(PathSeg element)) => Collections.any(this, f);
5704 5704
5705 List<PathSeg> toList() => new List<PathSeg>.from(this); 5705 List<PathSeg> toList() => new List<PathSeg>.from(this);
5706 Set<PathSeg> toSet() => new Set<PathSeg>.from(this); 5706 Set<PathSeg> toSet() => new Set<PathSeg>.from(this);
5707 5707
5708 bool get isEmpty => this.length == 0; 5708 bool get isEmpty => this.length == 0;
5709 5709
5710 List<PathSeg> take(int n) => IterableMixinWorkaround.takeList(this, n); 5710 List<PathSeg> take(int n) => new ListView<PathSeg>(this, 0, n);
5711 5711
5712 Iterable<PathSeg> takeWhile(bool test(PathSeg value)) { 5712 Iterable<PathSeg> takeWhile(bool test(PathSeg value)) {
5713 return IterableMixinWorkaround.takeWhile(this, test); 5713 return new TakeWhileIterable<PathSeg>(this, test);
5714 } 5714 }
5715 5715
5716 List<PathSeg> skip(int n) => IterableMixinWorkaround.skipList(this, n); 5716 List<PathSeg> skip(int n) => new ListView<PathSeg>(this, n, null);
5717 5717
5718 Iterable<PathSeg> skipWhile(bool test(PathSeg value)) { 5718 Iterable<PathSeg> skipWhile(bool test(PathSeg value)) {
5719 return IterableMixinWorkaround.skipWhile(this, test); 5719 return new SkipWhileIterable<PathSeg>(this, test);
5720 } 5720 }
5721 5721
5722 PathSeg firstMatching(bool test(PathSeg value), { PathSeg orElse() }) { 5722 PathSeg firstMatching(bool test(PathSeg value), { PathSeg orElse() }) {
5723 return IterableMixinWorkaround.firstMatching(this, test, orElse); 5723 return Collections.firstMatching(this, test, orElse);
5724 } 5724 }
5725 5725
5726 PathSeg lastMatching(bool test(PathSeg value), {PathSeg orElse()}) { 5726 PathSeg lastMatching(bool test(PathSeg value), {PathSeg orElse()}) {
5727 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); 5727 return Collections.lastMatchingInList(this, test, orElse);
5728 } 5728 }
5729 5729
5730 PathSeg singleMatching(bool test(PathSeg value)) { 5730 PathSeg singleMatching(bool test(PathSeg value)) {
5731 return IterableMixinWorkaround.singleMatching(this, test); 5731 return Collections.singleMatching(this, test);
5732 } 5732 }
5733 5733
5734 PathSeg elementAt(int index) { 5734 PathSeg elementAt(int index) {
5735 return this[index]; 5735 return this[index];
5736 } 5736 }
5737 5737
5738 // From Collection<PathSeg>: 5738 // From Collection<PathSeg>:
5739 5739
5740 void add(PathSeg value) { 5740 void add(PathSeg value) {
5741 throw new UnsupportedError("Cannot add to immutable List."); 5741 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
5777 if (this.length > 0) return this[this.length - 1]; 5777 if (this.length > 0) return this[this.length - 1];
5778 throw new StateError("No elements"); 5778 throw new StateError("No elements");
5779 } 5779 }
5780 5780
5781 PathSeg get single { 5781 PathSeg get single {
5782 if (length == 1) return this[0]; 5782 if (length == 1) return this[0];
5783 if (length == 0) throw new StateError("No elements"); 5783 if (length == 0) throw new StateError("No elements");
5784 throw new StateError("More than one element"); 5784 throw new StateError("More than one element");
5785 } 5785 }
5786 5786
5787 PathSeg min([int compare(PathSeg a, PathSeg b)]) => IterableMixinWorkaround.mi n(this, compare); 5787 PathSeg min([int compare(PathSeg a, PathSeg b)]) => Collections.min(this, comp are);
5788 5788
5789 PathSeg max([int compare(PathSeg a, PathSeg b)]) => IterableMixinWorkaround.ma x(this, compare); 5789 PathSeg max([int compare(PathSeg a, PathSeg b)]) => Collections.max(this, comp are);
5790 5790
5791 PathSeg removeAt(int pos) { 5791 PathSeg removeAt(int pos) {
5792 throw new UnsupportedError("Cannot removeAt on immutable List."); 5792 throw new UnsupportedError("Cannot removeAt on immutable List.");
5793 } 5793 }
5794 5794
5795 PathSeg removeLast() { 5795 PathSeg removeLast() {
5796 throw new UnsupportedError("Cannot removeLast on immutable List."); 5796 throw new UnsupportedError("Cannot removeLast on immutable List.");
5797 } 5797 }
5798 5798
5799 void setRange(int start, int rangeLength, List<PathSeg> from, [int startFrom]) { 5799 void setRange(int start, int rangeLength, List<PathSeg> from, [int startFrom]) {
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
6674 Iterator<String> get iterator { 6674 Iterator<String> get iterator {
6675 // Note: NodeLists are not fixed size. And most probably length shouldn't 6675 // Note: NodeLists are not fixed size. And most probably length shouldn't
6676 // be cached in both iterator _and_ forEach method. For now caching it 6676 // be cached in both iterator _and_ forEach method. For now caching it
6677 // for consistency. 6677 // for consistency.
6678 return new FixedSizeListIterator<String>(this); 6678 return new FixedSizeListIterator<String>(this);
6679 } 6679 }
6680 6680
6681 // SVG Collections expose numberOfItems rather than length. 6681 // SVG Collections expose numberOfItems rather than length.
6682 int get length => numberOfItems; 6682 int get length => numberOfItems;
6683 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, String)) { 6683 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, String)) {
6684 return IterableMixinWorkaround.reduce(this, initialValue, combine); 6684 return Collections.reduce(this, initialValue, combine);
6685 } 6685 }
6686 6686
6687 bool contains(String element) => IterableMixinWorkaround.contains(this, elemen t); 6687 bool contains(String element) => Collections.contains(this, element);
6688 6688
6689 void forEach(void f(String element)) => IterableMixinWorkaround.forEach(this, f); 6689 void forEach(void f(String element)) => Collections.forEach(this, f);
6690 6690
6691 String join([String separator]) => IterableMixinWorkaround.joinList(this, sepa rator); 6691 String join([String separator]) => Collections.joinList(this, separator);
6692 6692
6693 List mappedBy(f(String element)) => IterableMixinWorkaround.mappedByList(this, f); 6693 List mappedBy(f(String element)) => new MappedList<String, dynamic>(this, f);
6694 6694
6695 Iterable<String> where(bool f(String element)) => IterableMixinWorkaround.wher e(this, f); 6695 Iterable<String> where(bool f(String element)) => new WhereIterable<String>(th is, f);
6696 6696
6697 bool every(bool f(String element)) => IterableMixinWorkaround.every(this, f); 6697 bool every(bool f(String element)) => Collections.every(this, f);
6698 6698
6699 bool any(bool f(String element)) => IterableMixinWorkaround.any(this, f); 6699 bool any(bool f(String element)) => Collections.any(this, f);
6700 6700
6701 List<String> toList() => new List<String>.from(this); 6701 List<String> toList() => new List<String>.from(this);
6702 Set<String> toSet() => new Set<String>.from(this); 6702 Set<String> toSet() => new Set<String>.from(this);
6703 6703
6704 bool get isEmpty => this.length == 0; 6704 bool get isEmpty => this.length == 0;
6705 6705
6706 List<String> take(int n) => IterableMixinWorkaround.takeList(this, n); 6706 List<String> take(int n) => new ListView<String>(this, 0, n);
6707 6707
6708 Iterable<String> takeWhile(bool test(String value)) { 6708 Iterable<String> takeWhile(bool test(String value)) {
6709 return IterableMixinWorkaround.takeWhile(this, test); 6709 return new TakeWhileIterable<String>(this, test);
6710 } 6710 }
6711 6711
6712 List<String> skip(int n) => IterableMixinWorkaround.skipList(this, n); 6712 List<String> skip(int n) => new ListView<String>(this, n, null);
6713 6713
6714 Iterable<String> skipWhile(bool test(String value)) { 6714 Iterable<String> skipWhile(bool test(String value)) {
6715 return IterableMixinWorkaround.skipWhile(this, test); 6715 return new SkipWhileIterable<String>(this, test);
6716 } 6716 }
6717 6717
6718 String firstMatching(bool test(String value), { String orElse() }) { 6718 String firstMatching(bool test(String value), { String orElse() }) {
6719 return IterableMixinWorkaround.firstMatching(this, test, orElse); 6719 return Collections.firstMatching(this, test, orElse);
6720 } 6720 }
6721 6721
6722 String lastMatching(bool test(String value), {String orElse()}) { 6722 String lastMatching(bool test(String value), {String orElse()}) {
6723 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); 6723 return Collections.lastMatchingInList(this, test, orElse);
6724 } 6724 }
6725 6725
6726 String singleMatching(bool test(String value)) { 6726 String singleMatching(bool test(String value)) {
6727 return IterableMixinWorkaround.singleMatching(this, test); 6727 return Collections.singleMatching(this, test);
6728 } 6728 }
6729 6729
6730 String elementAt(int index) { 6730 String elementAt(int index) {
6731 return this[index]; 6731 return this[index];
6732 } 6732 }
6733 6733
6734 // From Collection<String>: 6734 // From Collection<String>:
6735 6735
6736 void add(String value) { 6736 void add(String value) {
6737 throw new UnsupportedError("Cannot add to immutable List."); 6737 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
6773 if (this.length > 0) return this[this.length - 1]; 6773 if (this.length > 0) return this[this.length - 1];
6774 throw new StateError("No elements"); 6774 throw new StateError("No elements");
6775 } 6775 }
6776 6776
6777 String get single { 6777 String get single {
6778 if (length == 1) return this[0]; 6778 if (length == 1) return this[0];
6779 if (length == 0) throw new StateError("No elements"); 6779 if (length == 0) throw new StateError("No elements");
6780 throw new StateError("More than one element"); 6780 throw new StateError("More than one element");
6781 } 6781 }
6782 6782
6783 String min([int compare(String a, String b)]) => IterableMixinWorkaround.min(t his, compare); 6783 String min([int compare(String a, String b)]) => Collections.min(this, compare );
6784 6784
6785 String max([int compare(String a, String b)]) => IterableMixinWorkaround.max(t his, compare); 6785 String max([int compare(String a, String b)]) => Collections.max(this, compare );
6786 6786
6787 String removeAt(int pos) { 6787 String removeAt(int pos) {
6788 throw new UnsupportedError("Cannot removeAt on immutable List."); 6788 throw new UnsupportedError("Cannot removeAt on immutable List.");
6789 } 6789 }
6790 6790
6791 String removeLast() { 6791 String removeLast() {
6792 throw new UnsupportedError("Cannot removeLast on immutable List."); 6792 throw new UnsupportedError("Cannot removeLast on immutable List.");
6793 } 6793 }
6794 6794
6795 void setRange(int start, int rangeLength, List<String> from, [int startFrom]) { 6795 void setRange(int start, int rangeLength, List<String> from, [int startFrom]) {
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
7967 Iterator<Transform> get iterator { 7967 Iterator<Transform> get iterator {
7968 // Note: NodeLists are not fixed size. And most probably length shouldn't 7968 // Note: NodeLists are not fixed size. And most probably length shouldn't
7969 // be cached in both iterator _and_ forEach method. For now caching it 7969 // be cached in both iterator _and_ forEach method. For now caching it
7970 // for consistency. 7970 // for consistency.
7971 return new FixedSizeListIterator<Transform>(this); 7971 return new FixedSizeListIterator<Transform>(this);
7972 } 7972 }
7973 7973
7974 // SVG Collections expose numberOfItems rather than length. 7974 // SVG Collections expose numberOfItems rather than length.
7975 int get length => numberOfItems; 7975 int get length => numberOfItems;
7976 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Transform)) { 7976 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Transform)) {
7977 return IterableMixinWorkaround.reduce(this, initialValue, combine); 7977 return Collections.reduce(this, initialValue, combine);
7978 } 7978 }
7979 7979
7980 bool contains(Transform element) => IterableMixinWorkaround.contains(this, ele ment); 7980 bool contains(Transform element) => Collections.contains(this, element);
7981 7981
7982 void forEach(void f(Transform element)) => IterableMixinWorkaround.forEach(thi s, f); 7982 void forEach(void f(Transform element)) => Collections.forEach(this, f);
7983 7983
7984 String join([String separator]) => IterableMixinWorkaround.joinList(this, sepa rator); 7984 String join([String separator]) => Collections.joinList(this, separator);
7985 7985
7986 List mappedBy(f(Transform element)) => IterableMixinWorkaround.mappedByList(th is, f); 7986 List mappedBy(f(Transform element)) => new MappedList<Transform, dynamic>(this , f);
7987 7987
7988 Iterable<Transform> where(bool f(Transform element)) => IterableMixinWorkaroun d.where(this, f); 7988 Iterable<Transform> where(bool f(Transform element)) => new WhereIterable<Tran sform>(this, f);
7989 7989
7990 bool every(bool f(Transform element)) => IterableMixinWorkaround.every(this, f ); 7990 bool every(bool f(Transform element)) => Collections.every(this, f);
7991 7991
7992 bool any(bool f(Transform element)) => IterableMixinWorkaround.any(this, f); 7992 bool any(bool f(Transform element)) => Collections.any(this, f);
7993 7993
7994 List<Transform> toList() => new List<Transform>.from(this); 7994 List<Transform> toList() => new List<Transform>.from(this);
7995 Set<Transform> toSet() => new Set<Transform>.from(this); 7995 Set<Transform> toSet() => new Set<Transform>.from(this);
7996 7996
7997 bool get isEmpty => this.length == 0; 7997 bool get isEmpty => this.length == 0;
7998 7998
7999 List<Transform> take(int n) => IterableMixinWorkaround.takeList(this, n); 7999 List<Transform> take(int n) => new ListView<Transform>(this, 0, n);
8000 8000
8001 Iterable<Transform> takeWhile(bool test(Transform value)) { 8001 Iterable<Transform> takeWhile(bool test(Transform value)) {
8002 return IterableMixinWorkaround.takeWhile(this, test); 8002 return new TakeWhileIterable<Transform>(this, test);
8003 } 8003 }
8004 8004
8005 List<Transform> skip(int n) => IterableMixinWorkaround.skipList(this, n); 8005 List<Transform> skip(int n) => new ListView<Transform>(this, n, null);
8006 8006
8007 Iterable<Transform> skipWhile(bool test(Transform value)) { 8007 Iterable<Transform> skipWhile(bool test(Transform value)) {
8008 return IterableMixinWorkaround.skipWhile(this, test); 8008 return new SkipWhileIterable<Transform>(this, test);
8009 } 8009 }
8010 8010
8011 Transform firstMatching(bool test(Transform value), { Transform orElse() }) { 8011 Transform firstMatching(bool test(Transform value), { Transform orElse() }) {
8012 return IterableMixinWorkaround.firstMatching(this, test, orElse); 8012 return Collections.firstMatching(this, test, orElse);
8013 } 8013 }
8014 8014
8015 Transform lastMatching(bool test(Transform value), {Transform orElse()}) { 8015 Transform lastMatching(bool test(Transform value), {Transform orElse()}) {
8016 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); 8016 return Collections.lastMatchingInList(this, test, orElse);
8017 } 8017 }
8018 8018
8019 Transform singleMatching(bool test(Transform value)) { 8019 Transform singleMatching(bool test(Transform value)) {
8020 return IterableMixinWorkaround.singleMatching(this, test); 8020 return Collections.singleMatching(this, test);
8021 } 8021 }
8022 8022
8023 Transform elementAt(int index) { 8023 Transform elementAt(int index) {
8024 return this[index]; 8024 return this[index];
8025 } 8025 }
8026 8026
8027 // From Collection<Transform>: 8027 // From Collection<Transform>:
8028 8028
8029 void add(Transform value) { 8029 void add(Transform value) {
8030 throw new UnsupportedError("Cannot add to immutable List."); 8030 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
8066 if (this.length > 0) return this[this.length - 1]; 8066 if (this.length > 0) return this[this.length - 1];
8067 throw new StateError("No elements"); 8067 throw new StateError("No elements");
8068 } 8068 }
8069 8069
8070 Transform get single { 8070 Transform get single {
8071 if (length == 1) return this[0]; 8071 if (length == 1) return this[0];
8072 if (length == 0) throw new StateError("No elements"); 8072 if (length == 0) throw new StateError("No elements");
8073 throw new StateError("More than one element"); 8073 throw new StateError("More than one element");
8074 } 8074 }
8075 8075
8076 Transform min([int compare(Transform a, Transform b)]) => IterableMixinWorkaro und.min(this, compare); 8076 Transform min([int compare(Transform a, Transform b)]) => Collections.min(this , compare);
8077 8077
8078 Transform max([int compare(Transform a, Transform b)]) => IterableMixinWorkaro und.max(this, compare); 8078 Transform max([int compare(Transform a, Transform b)]) => Collections.max(this , compare);
8079 8079
8080 Transform removeAt(int pos) { 8080 Transform removeAt(int pos) {
8081 throw new UnsupportedError("Cannot removeAt on immutable List."); 8081 throw new UnsupportedError("Cannot removeAt on immutable List.");
8082 } 8082 }
8083 8083
8084 Transform removeLast() { 8084 Transform removeLast() {
8085 throw new UnsupportedError("Cannot removeLast on immutable List."); 8085 throw new UnsupportedError("Cannot removeLast on immutable List.");
8086 } 8086 }
8087 8087
8088 void setRange(int start, int rangeLength, List<Transform> from, [int startFrom ]) { 8088 void setRange(int start, int rangeLength, List<Transform> from, [int startFrom ]) {
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
8532 // From Iterable<ElementInstance>: 8532 // From Iterable<ElementInstance>:
8533 8533
8534 Iterator<ElementInstance> get iterator { 8534 Iterator<ElementInstance> get iterator {
8535 // Note: NodeLists are not fixed size. And most probably length shouldn't 8535 // Note: NodeLists are not fixed size. And most probably length shouldn't
8536 // be cached in both iterator _and_ forEach method. For now caching it 8536 // be cached in both iterator _and_ forEach method. For now caching it
8537 // for consistency. 8537 // for consistency.
8538 return new FixedSizeListIterator<ElementInstance>(this); 8538 return new FixedSizeListIterator<ElementInstance>(this);
8539 } 8539 }
8540 8540
8541 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, ElementInstance) ) { 8541 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, ElementInstance) ) {
8542 return IterableMixinWorkaround.reduce(this, initialValue, combine); 8542 return Collections.reduce(this, initialValue, combine);
8543 } 8543 }
8544 8544
8545 bool contains(ElementInstance element) => IterableMixinWorkaround.contains(thi s, element); 8545 bool contains(ElementInstance element) => Collections.contains(this, element);
8546 8546
8547 void forEach(void f(ElementInstance element)) => IterableMixinWorkaround.forEa ch(this, f); 8547 void forEach(void f(ElementInstance element)) => Collections.forEach(this, f);
8548 8548
8549 String join([String separator]) => IterableMixinWorkaround.joinList(this, sepa rator); 8549 String join([String separator]) => Collections.joinList(this, separator);
8550 8550
8551 List mappedBy(f(ElementInstance element)) => IterableMixinWorkaround.mappedByL ist(this, f); 8551 List mappedBy(f(ElementInstance element)) => new MappedList<ElementInstance, d ynamic>(this, f);
8552 8552
8553 Iterable<ElementInstance> where(bool f(ElementInstance element)) => IterableMi xinWorkaround.where(this, f); 8553 Iterable<ElementInstance> where(bool f(ElementInstance element)) => new WhereI terable<ElementInstance>(this, f);
8554 8554
8555 bool every(bool f(ElementInstance element)) => IterableMixinWorkaround.every(t his, f); 8555 bool every(bool f(ElementInstance element)) => Collections.every(this, f);
8556 8556
8557 bool any(bool f(ElementInstance element)) => IterableMixinWorkaround.any(this, f); 8557 bool any(bool f(ElementInstance element)) => Collections.any(this, f);
8558 8558
8559 List<ElementInstance> toList() => new List<ElementInstance>.from(this); 8559 List<ElementInstance> toList() => new List<ElementInstance>.from(this);
8560 Set<ElementInstance> toSet() => new Set<ElementInstance>.from(this); 8560 Set<ElementInstance> toSet() => new Set<ElementInstance>.from(this);
8561 8561
8562 bool get isEmpty => this.length == 0; 8562 bool get isEmpty => this.length == 0;
8563 8563
8564 List<ElementInstance> take(int n) => IterableMixinWorkaround.takeList(this, n) ; 8564 List<ElementInstance> take(int n) => new ListView<ElementInstance>(this, 0, n) ;
8565 8565
8566 Iterable<ElementInstance> takeWhile(bool test(ElementInstance value)) { 8566 Iterable<ElementInstance> takeWhile(bool test(ElementInstance value)) {
8567 return IterableMixinWorkaround.takeWhile(this, test); 8567 return new TakeWhileIterable<ElementInstance>(this, test);
8568 } 8568 }
8569 8569
8570 List<ElementInstance> skip(int n) => IterableMixinWorkaround.skipList(this, n) ; 8570 List<ElementInstance> skip(int n) => new ListView<ElementInstance>(this, n, nu ll);
8571 8571
8572 Iterable<ElementInstance> skipWhile(bool test(ElementInstance value)) { 8572 Iterable<ElementInstance> skipWhile(bool test(ElementInstance value)) {
8573 return IterableMixinWorkaround.skipWhile(this, test); 8573 return new SkipWhileIterable<ElementInstance>(this, test);
8574 } 8574 }
8575 8575
8576 ElementInstance firstMatching(bool test(ElementInstance value), { ElementInsta nce orElse() }) { 8576 ElementInstance firstMatching(bool test(ElementInstance value), { ElementInsta nce orElse() }) {
8577 return IterableMixinWorkaround.firstMatching(this, test, orElse); 8577 return Collections.firstMatching(this, test, orElse);
8578 } 8578 }
8579 8579
8580 ElementInstance lastMatching(bool test(ElementInstance value), {ElementInstanc e orElse()}) { 8580 ElementInstance lastMatching(bool test(ElementInstance value), {ElementInstanc e orElse()}) {
8581 return IterableMixinWorkaround.lastMatchingInList(this, test, orElse); 8581 return Collections.lastMatchingInList(this, test, orElse);
8582 } 8582 }
8583 8583
8584 ElementInstance singleMatching(bool test(ElementInstance value)) { 8584 ElementInstance singleMatching(bool test(ElementInstance value)) {
8585 return IterableMixinWorkaround.singleMatching(this, test); 8585 return Collections.singleMatching(this, test);
8586 } 8586 }
8587 8587
8588 ElementInstance elementAt(int index) { 8588 ElementInstance elementAt(int index) {
8589 return this[index]; 8589 return this[index];
8590 } 8590 }
8591 8591
8592 // From Collection<ElementInstance>: 8592 // From Collection<ElementInstance>:
8593 8593
8594 void add(ElementInstance value) { 8594 void add(ElementInstance value) {
8595 throw new UnsupportedError("Cannot add to immutable List."); 8595 throw new UnsupportedError("Cannot add to immutable List.");
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
8633 if (this.length > 0) return this[this.length - 1]; 8633 if (this.length > 0) return this[this.length - 1];
8634 throw new StateError("No elements"); 8634 throw new StateError("No elements");
8635 } 8635 }
8636 8636
8637 ElementInstance get single { 8637 ElementInstance get single {
8638 if (length == 1) return this[0]; 8638 if (length == 1) return this[0];
8639 if (length == 0) throw new StateError("No elements"); 8639 if (length == 0) throw new StateError("No elements");
8640 throw new StateError("More than one element"); 8640 throw new StateError("More than one element");
8641 } 8641 }
8642 8642
8643 ElementInstance min([int compare(ElementInstance a, ElementInstance b)]) => It erableMixinWorkaround.min(this, compare); 8643 ElementInstance min([int compare(ElementInstance a, ElementInstance b)]) => Co llections.min(this, compare);
8644 8644
8645 ElementInstance max([int compare(ElementInstance a, ElementInstance b)]) => It erableMixinWorkaround.max(this, compare); 8645 ElementInstance max([int compare(ElementInstance a, ElementInstance b)]) => Co llections.max(this, compare);
8646 8646
8647 ElementInstance removeAt(int pos) { 8647 ElementInstance removeAt(int pos) {
8648 throw new UnsupportedError("Cannot removeAt on immutable List."); 8648 throw new UnsupportedError("Cannot removeAt on immutable List.");
8649 } 8649 }
8650 8650
8651 ElementInstance removeLast() { 8651 ElementInstance removeLast() {
8652 throw new UnsupportedError("Cannot removeLast on immutable List."); 8652 throw new UnsupportedError("Cannot removeLast on immutable List.");
8653 } 8653 }
8654 8654
8655 void setRange(int start, int rangeLength, List<ElementInstance> from, [int sta rtFrom]) { 8655 void setRange(int start, int rangeLength, List<ElementInstance> from, [int sta rtFrom]) {
(...skipping 11 matching lines...) Expand all
8667 List<ElementInstance> getRange(int start, int rangeLength) => 8667 List<ElementInstance> getRange(int start, int rangeLength) =>
8668 Lists.getRange(this, start, rangeLength, <ElementInstance>[]); 8668 Lists.getRange(this, start, rangeLength, <ElementInstance>[]);
8669 8669
8670 // -- end List<ElementInstance> mixins. 8670 // -- end List<ElementInstance> mixins.
8671 8671
8672 @DocsEditable 8672 @DocsEditable
8673 @DomName('SVGElementInstanceList.item') 8673 @DomName('SVGElementInstanceList.item')
8674 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback"; 8674 ElementInstance item(int index) native "SVGElementInstanceList_item_Callback";
8675 8675
8676 } 8676 }
OLDNEW
« no previous file with comments | « sdk/lib/svg/dart2js/svg_dart2js.dart ('k') | tests/corelib/iterable_min_max_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698