|
@@ -2,17 +2,22 @@ package io.zipcoder;
|
2
|
2
|
|
3
|
3
|
import java.io.FileNotFoundException;
|
4
|
4
|
import java.io.FileReader;
|
|
5
|
+import java.util.Iterator;
|
5
|
6
|
import java.util.Scanner;
|
6
|
7
|
|
7
|
8
|
public class WC {
|
8
|
|
- private Scanner sc;
|
|
9
|
+ private Iterator<String> si;
|
9
|
10
|
|
10
|
11
|
public WC(String fileName) {
|
11
|
12
|
try {
|
12
|
|
- sc = new Scanner(new FileReader(fileName));
|
|
13
|
+ this.si = new Scanner(new FileReader(fileName));
|
13
|
14
|
} catch (FileNotFoundException e) {
|
14
|
15
|
System.out.println(fileName + " Does Not Exist");
|
15
|
16
|
System.exit(-1);
|
16
|
17
|
}
|
17
|
18
|
}
|
|
19
|
+
|
|
20
|
+ public WC(Iterator<String> si) {
|
|
21
|
+ this.si = si;
|
|
22
|
+ }
|
18
|
23
|
}
|