Tariq Hook 7 years ago
parent
commit
7af1ca3e15

+ 0
- 13
src/main/java/io/zipcoder/Item.java View File

26
         return name;
26
         return name;
27
     }
27
     }
28
 
28
 
29
-    public void setName(String name) {
30
-        this.name = name;
31
-    }
32
 
29
 
33
     public Double getPrice() {
30
     public Double getPrice() {
34
         return price;
31
         return price;
35
     }
32
     }
36
 
33
 
37
-    public void setPrice(Double price) {
38
-        this.price = price;
39
-    }
40
 
34
 
41
     public String getType() {
35
     public String getType() {
42
         return type;
36
         return type;
43
     }
37
     }
44
 
38
 
45
-    public void setType(String type) {
46
-        this.type = type;
47
-    }
48
 
39
 
49
     public String getExpiration() {
40
     public String getExpiration() {
50
         return expiration;
41
         return expiration;
51
     }
42
     }
52
 
43
 
53
-    public void setExpiration(String expiration) {
54
-        this.expiration = expiration;
55
-    }
56
-
57
     @Override
44
     @Override
58
     public String toString(){
45
     public String toString(){
59
         return "name:" + name + " price:" + price + " type:" + type + " expiration:" + expiration;
46
         return "name:" + name + " price:" + price + " type:" + type + " expiration:" + expiration;

+ 1
- 6
src/main/java/io/zipcoder/ItemParser.java View File

5
 
5
 
6
 public class ItemParser {
6
 public class ItemParser {
7
 
7
 
8
-    /**
9
-     *
10
-     * @param rawData
11
-     * @return
12
-     */
13
 
8
 
14
     public ArrayList<String> parseRawDataIntoStringArray(String rawData){
9
     public ArrayList<String> parseRawDataIntoStringArray(String rawData){
15
         String stringPattern = "##";
10
         String stringPattern = "##";
22
     }
17
     }
23
 
18
 
24
     public ArrayList<String> findKeyValuePairsInRawItemData(String rawItem){
19
     public ArrayList<String> findKeyValuePairsInRawItemData(String rawItem){
25
-        String stringPattern = ";";
20
+        String stringPattern = "[;|^]";
26
         ArrayList<String> response = splitStringWithRegexPattern(stringPattern , rawItem);
21
         ArrayList<String> response = splitStringWithRegexPattern(stringPattern , rawItem);
27
         return response;
22
         return response;
28
     }
23
     }

+ 2
- 0
src/main/java/io/zipcoder/Main.java View File

2
 
2
 
3
 import org.apache.commons.io.IOUtils;
3
 import org.apache.commons.io.IOUtils;
4
 
4
 
5
+
5
 public class Main {
6
 public class Main {
6
 
7
 
7
     public String readRawDataToString() throws Exception{
8
     public String readRawDataToString() throws Exception{
12
 
13
 
13
     public static void main(String[] args) throws Exception{
14
     public static void main(String[] args) throws Exception{
14
         String output = (new Main()).readRawDataToString();
15
         String output = (new Main()).readRawDataToString();
16
+        System.out.println(output);
15
         // TODO: parse the data in output into items, and display to console.
17
         // TODO: parse the data in output into items, and display to console.
16
     }
18
     }
17
 }
19
 }