Katrice Williams-Dredden пре 6 година
родитељ
комит
4c8d2e034b
1 измењених фајлова са 17 додато и 0 уклоњено
  1. 17
    0
      src/main/java/io/zipcoder/UnsafeCopier.java

+ 17
- 0
src/main/java/io/zipcoder/UnsafeCopier.java Прегледај датотеку

@@ -6,9 +6,26 @@ package io.zipcoder;
6 6
 public class UnsafeCopier extends Copier {
7 7
 
8 8
     public UnsafeCopier(String toCopy) {
9
+
9 10
         super(toCopy);
10 11
     }
11 12
 
12 13
     public void run() {
14
+        while(stringIterator.hasNext()){
15
+            copied += stringIterator.next()+" ";
16
+        }
13 17
     }
14 18
 }
19
+
20
+//PseudoCode
21
+//loop through the array in copier.java
22
+// monkey needs to grab the next word
23
+//append it to the copy
24
+//monkeytypewriter will create 5 monkey(threads) and use this class to start them
25
+
26
+//Ex of run method
27
+//tried a for loop initially and couldn't figure out what should be in the comparable part
28
+//so while stringIterator(which was turned into an arraylist in copier.java) knows our iteration
29
+//has more elements, then add the stringIterators next value to copied plus the space.
30
+
31
+