From 19d36d34640572cd8d9735b333ba77e809aaf1dc Mon Sep 17 00:00:00 2001 From: Sabine Gubitz Date: Tue, 10 Jan 2023 15:59:16 +0100 Subject: [PATCH] =?UTF-8?q?Order=20Klasse=20gef=C3=BCllt,=20sowie=20readOr?= =?UTF-8?q?der=20Datentypen=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data.java | 16 ++++++++-------- src/Order.java | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) 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; + } }