From 644df46a7abd9905a0655c101e08bc04a4fa511c Mon Sep 17 00:00:00 2001 From: Sabine Gubitz Date: Tue, 10 Jan 2023 16:23:10 +0100 Subject: [PATCH] Order Klasse angepasst, sowie readOrder angepasst --- src/Data.java | 16 ++++------------ src/Order.java | 29 +++++++---------------------- 2 files changed, 11 insertions(+), 34 deletions(-) diff --git a/src/Data.java b/src/Data.java index 89f6c93..27a46ef 100644 --- a/src/Data.java +++ b/src/Data.java @@ -184,18 +184,10 @@ public class Data { String[] parts = row.split(";"); String date = parts[0]; - String meat = parts[1]; - int meatCount = Integer.parseInt(parts[2]); - String vegi = parts[3]; - int vegiCount = Integer.parseInt(parts[4]); - String vegan = parts[5]; - int veganCount = Integer.parseInt(parts[6]); - String desertV = parts[7]; - int desertVCount = Integer.parseInt(parts[8]); - String desert = parts[9]; - int desertCount = Integer.parseInt(parts[10]); - orderList.add(new Order(date, meat, meatCount,vegi, vegiCount, vegan, veganCount, desertV, - desertVCount, desert, desertCount)); + String user = parts[1]; + String mealtyp = parts[3]; + String deserttyp = parts[5]; + orderList.add(new Order(date, user, mealtyp, deserttyp)); } return null;//orderList diff --git a/src/Order.java b/src/Order.java index d861f17..3baf930 100644 --- a/src/Order.java +++ b/src/Order.java @@ -1,29 +1,14 @@ 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; + String user; + String mealtyp; + String deserttyp; - 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 user, String mealtyp, String deserttyp) { 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; + this.user = user; + this.mealtyp = mealtyp; + this.deserttyp = deserttyp; } }