Order Klasse gefüllt, sowie readOrder Datentypen angepasst

This commit is contained in:
Sabine Gubitz 2023-01-10 15:59:16 +01:00
parent 12a8806fb6
commit 19d36d3464
2 changed files with 35 additions and 8 deletions

View File

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

View File

@ -1,2 +1,29 @@
public class Order { 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;
}
} }