39
39
*/
40
40
public class Iterators {
41
41
42
- public static <I , O > Iterator <O > createCompoundIterator (Iterable <I > inputs , Function <I , Iterator <O >> convertor ) {
43
- return new CompoundIterator <>(inputs , convertor );
42
+ public static <I , O > Iterator <O > createCompoundIterator (Iterable <I > inputs , Function <I , Iterator <O >> converter ) {
43
+ return new CompoundIterator <>(inputs , converter );
44
44
}
45
45
46
46
private static class CompoundIterator <I , O > implements Iterator <O > {
47
47
48
48
private final Iterator <I > inputs ;
49
- private final Function <I , Iterator <O >> convertor ;
49
+ private final Function <I , Iterator <O >> converter ;
50
50
@ SuppressWarnings ("unchecked" )
51
51
private Iterator <O > currentIterator = EMPTY ;
52
52
53
- public CompoundIterator (Iterable <I > inputs , Function <I , Iterator <O >> convertor ) {
53
+ public CompoundIterator (Iterable <I > inputs , Function <I , Iterator <O >> converter ) {
54
54
this .inputs = inputs .iterator ();
55
- this .convertor = convertor ;
55
+ this .converter = converter ;
56
56
}
57
57
58
58
public boolean hasNext () {
@@ -75,7 +75,7 @@ public void remove() {
75
75
76
76
private void update () {
77
77
while (inputs .hasNext ()) {
78
- currentIterator = convertor .apply (inputs .next ());
78
+ currentIterator = converter .apply (inputs .next ());
79
79
if (currentIterator .hasNext ()) return ;
80
80
}
81
81
currentIterator = null ;
0 commit comments