start of new file
[IRC.git] / Robust / src / Benchmarks / Scheduling / MapReduce / Splitter.java
1 public class Splitter {
2     String filename;
3     String content;
4     int length;
5     String[] slices;
6
7     public Splitter(String inputfile, int splitNum, char seperator) {
8         //System.printString("Top of Splitter's constructor\n");
9         filename = new String("tmp");
10         content = inputfile;
11         //System.printString(content + "\n");
12         
13         this.slices = new String[splitNum];
14         this.slices[0] = content;
15     }
16
17     public void split() {
18         if(slices.length == 1) {
19             return;
20         }
21         for(int i = 1; i < this.slices.length; ++i) {
22             slices[i] = new String(content.toCharArray());
23         }
24     }
25
26     public String getFilename() {
27         return filename;
28     }
29
30     public String[] getSlices() {
31         return this.slices;
32     }
33 }