Selaa lähdekoodia

in progress for sure

thulasi 6 vuotta sitten
vanhempi
commit
79b2d64338

+ 19
- 1
src/main/java/rocks/zipcode/io/quiz4/collections/SimpleStringGroup.java Näytä tiedosto

@@ -1,12 +1,15 @@
1 1
 package rocks.zipcode.io.quiz4.collections;
2 2
 
3 3
 import java.util.ArrayList;
4
+import java.util.Iterator;
4 5
 import java.util.List;
6
+import java.util.Spliterator;
7
+import java.util.function.Consumer;
5 8
 
6 9
 /**
7 10
  * @author leon on 11/12/2018.
8 11
  */
9
-public class SimpleStringGroup {
12
+public class SimpleStringGroup implements Iterable {
10 13
     List<String> stringGroup;
11 14
 
12 15
     public SimpleStringGroup() {
@@ -36,4 +39,19 @@ public class SimpleStringGroup {
36 39
     public void clear() {
37 40
         stringGroup.clear();
38 41
     }
42
+
43
+    @Override
44
+    public Iterator iterator() {
45
+        return this.iterator();
46
+    }
47
+
48
+    @Override
49
+    public void forEach(Consumer action) {
50
+        this.stringGroup.forEach(action);
51
+    }
52
+
53
+    @Override
54
+    public Spliterator spliterator() {
55
+        return null;
56
+    }
39 57
 }