diff --git a/src/Data.java b/src/Data.java index 93156ed..89f6c93 100644 --- a/src/Data.java +++ b/src/Data.java @@ -177,7 +177,7 @@ public class Data { */ public ArrayList readOrder() { - ArrayList orderList = new ArrayList<>(); + ArrayList orderList = new ArrayList<>(); List rows = getRows(); for (String row : rows) { @@ -185,17 +185,17 @@ public class Data { String date = parts[0]; String meat = parts[1]; - String meatCount = parts[2]; + int meatCount = Integer.parseInt(parts[2]); String vegi = parts[3]; - String vegiCount = parts[4]; + int vegiCount = Integer.parseInt(parts[4]); String vegan = parts[5]; - String veganCount = parts[6]; + int veganCount = Integer.parseInt(parts[6]); String desertV = parts[7]; - String desertVCount = parts[8]; + int desertVCount = Integer.parseInt(parts[8]); String desert = parts[9]; - String desertCount = parts[10]; - //orderList.add(new Order(date, meat, meatCount,vegi, vegiCount, vegan, veganCount, desertV, - // desertVCount, desert, desertCount)) + int desertCount = Integer.parseInt(parts[10]); + orderList.add(new Order(date, meat, meatCount,vegi, vegiCount, vegan, veganCount, desertV, + desertVCount, desert, desertCount)); } return null;//orderList diff --git a/src/Order.java b/src/Order.java index a4d1920..d861f17 100644 --- a/src/Order.java +++ b/src/Order.java @@ -1,2 +1,29 @@ public class Order { + String date; + String meat; + int meatCount; + String vegi; + int vegiCount; + String vegan; + int veganCount; + String desertV; + int desertVCount; + String desert; + int desertCount; + + Order (String date, String meat, int meatCount, String vegi, int vegiCount, String vegan, int veganCount, + String desertV, int desertVCount, String desert, int desertCount) + { + this.date = date; + this.meat = meat; + this.meatCount = meatCount; + this.vegi = vegi; + this.vegiCount = vegiCount; + this.vegan = vegan; + this.veganCount = veganCount; + this.desertV = desertV; + this.desertVCount = desertVCount; + this.desert = desert; + this.desertCount = desertCount; + } }