Korrektur der Syntax und Überabeitung der Kommentare

This commit is contained in:
Felix Wöstemeyer 2022-12-19 15:28:14 +01:00
parent 93bf389472
commit 044f64635b
5 changed files with 29 additions and 44 deletions

View File

@ -24,7 +24,6 @@ public class Data {
* *
* @return Arraylist userList * @return Arraylist userList
* @author Madeleine Vigier, Sabine Gubitz * @author Madeleine Vigier, Sabine Gubitz
* @version 1.3
*/ */
public ArrayList<User> readUser() { public ArrayList<User> readUser() {
List<String> rows = getRows(); List<String> rows = getRows();
@ -51,12 +50,11 @@ public class Data {
* *
* @return Arraylist menuelist * @return Arraylist menuelist
* @author Madeleine Vigier, Sabine Gubitz * @author Madeleine Vigier, Sabine Gubitz
* @version 1.3
*/ */
public ArrayList<Menue> readMenue() { public ArrayList<Menu> readMenu() {
List<String> rows = getRows(); List<String> rows = getRows();
ArrayList<Menue> menueList = new ArrayList<>(); ArrayList<Menu> menuList = new ArrayList<>();
for (String row : rows) { for (String row : rows) {
@ -165,9 +163,9 @@ public class Data {
} }
String end = parts[26]; //endpoint String end = parts[26]; //endpoint
menueList.add(new Menue(date, dish, sideDish, typ, ingredients)); menuList.add(new Menu(date, dish, sideDish, typ, ingredients));
} }
return menueList; return menuList;
} }
@ -176,7 +174,6 @@ public class Data {
* *
* @return Arraylist orderlist * @return Arraylist orderlist
* @author Madeleine Vigier, Sabine Gubitz * @author Madeleine Vigier, Sabine Gubitz
* @version 1.2
*/ */
public ArrayList<Order> readOrder() { public ArrayList<Order> readOrder() {
@ -223,7 +220,6 @@ public class Data {
* *
* @return ArrayList rows * @return ArrayList rows
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
private List<String> getRows() { private List<String> getRows() {
Path path = Paths.get(pathRead); Path path = Paths.get(pathRead);

View File

@ -8,17 +8,17 @@ public class Execute {
public static void main(String[] args) { public static void main(String[] args) {
//EXECUTE MENUE OVERVIEW //EXECUTE MENUE OVERVIEW
Data data = new Data("menue.txt"); Data data = new Data("menue.txt");
ArrayList<Menue> menue = data.readMenue(); ArrayList<Menu> menu = data.readMenu();
for (int i = 0; i < menue.size(); i++) { for (int i = 0; i < menu.size(); i++) {
if (i % 4 == 0) { if (i % 4 == 0) {
System.out.println(); System.out.println();
System.out.println("--------------------------------------"); System.out.println("--------------------------------------");
System.out.println(GeneralMethods.getDayNumberNew(menue.get(i).getDate())); System.out.println(GeneralMethods.getDayNumberNew(menu.get(i).getDate()));
System.out.println(menue.get(i).getDate()); System.out.println(menu.get(i).getDate());
System.out.println(); System.out.println();
} }
System.out.println(menue.get(i)); System.out.println(menu.get(i));
} }
System.out.println("a: Eier; b: Soja, c: Milch; d: Erdnüsse; e: Weichtiere; f: Krebstiere; g: Getreide; h: Senf\n" System.out.println("a: Eier; b: Soja, c: Milch; d: Erdnüsse; e: Weichtiere; f: Krebstiere; g: Getreide; h: Senf\n"

View File

@ -14,8 +14,8 @@ import java.util.Locale;
/** /**
* GeneralMethods is a class for commen public methods. * GeneralMethods is a class for commen public methods.
* *
* @version 1.0 * @author Felix Wöstemeyer
* @auhtor Felix Wöstemeyer * @version 1.4
*/ */
public class GeneralMethods { public class GeneralMethods {
@ -24,7 +24,6 @@ public class GeneralMethods {
* *
* @param dateString date as String e.g. 12.12.2022 * @param dateString date as String e.g. 12.12.2022
* @return the Number of day in week * @return the Number of day in week
* @version 1.0
* @author Madeleine Vigier * @author Madeleine Vigier
*/ */
public static String getDayNumberNew(String dateString) { public static String getDayNumberNew(String dateString) {
@ -42,7 +41,6 @@ public class GeneralMethods {
* *
* @param dayNumber dayNumber e.g. 1 for Monday * @param dayNumber dayNumber e.g. 1 for Monday
* @return weekday * @return weekday
* @version 1.0
* @author Madeleine Vigier * @author Madeleine Vigier
*/ */
public static String getDayName(int dayNumber) { public static String getDayName(int dayNumber) {

View File

@ -1,12 +1,12 @@
import java.util.List; import java.util.List;
/** /**
* Menue is a class to built a menue * Menu is a class to built a menu
* *
* @author: Madeleine Vigier * @author Madeleine Vigier
* @version: 1.0 * @version 1.1
*/ */
public class Menue { public class Menu {
String date; String date;
String dish; String dish;
String sideDish; String sideDish;
@ -23,7 +23,7 @@ public class Menue {
* @param typ vegan, vegetarian or meat * @param typ vegan, vegetarian or meat
* @param ingredients list of ingredients * @param ingredients list of ingredients
*/ */
public Menue(String date, String dish, String sideDish, String typ, List<String> ingredients) { public Menu(String date, String dish, String sideDish, String typ, List<String> ingredients) {
this.date = date; this.date = date;
this.dish = dish; this.dish = dish;
this.sideDish = sideDish; this.sideDish = sideDish;
@ -36,7 +36,6 @@ public class Menue {
* *
* @return date * @return date
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
public String getDate() { public String getDate() {
return date; return date;
@ -47,7 +46,6 @@ public class Menue {
* *
* @return typ e.g. Vegan * @return typ e.g. Vegan
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
public String getTyp() { public String getTyp() {
if (typ.contains("DessertV") || typ.contains("Dessert")) { if (typ.contains("DessertV") || typ.contains("Dessert")) {
@ -62,9 +60,8 @@ public class Menue {
/** /**
* The method toString() returns a String representation of an object * The method toString() returns a String representation of an object
* *
* @return a String with dish, sideDish, list of ingredients and the typ of the menue * @return a String with dish, sideDish, list of ingredients and the typ of the menu
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
@Override @Override
public String toString() { public String toString() {

View File

@ -2,33 +2,32 @@
* User class creates User Objects * User class creates User Objects
* *
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.1 * @version 1.2
*/ */
public class User { public class User {
private String nameParent1; private String nameParent1;
private String nameParent2; private String nameParent2;
private String billAddress; private String billAddress;
private String phonenumber; private String phoneNumber;
private String nameChildren; private String nameChildren;
private String password; private String password;
/** /**
* constructor * constructor
* *
* @param nameParent1 * @param nameParent1 name of the first parent of the child
* @param nameParent2 * @param nameParent2 name of the second parent of the child
* @param billAddress * @param billAddress the address the bill should be sent to
* @param phonenumber * @param phoneNumber phonenumber of one of the parents and also the username
* @param nameChildren * @param nameChildren name of the child
* @param password * @param password password of the user
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
public User(String nameParent1, String nameParent2, String billAddress, String phonenumber, String nameChildren, String password) { public User(String nameParent1, String nameParent2, String billAddress, String phoneNumber, String nameChildren, String password) {
this.nameParent1 = nameParent1; this.nameParent1 = nameParent1;
this.nameParent2 = nameParent2; this.nameParent2 = nameParent2;
this.billAddress = billAddress; this.billAddress = billAddress;
this.phonenumber = phonenumber; this.phoneNumber = phoneNumber;
this.nameChildren = nameChildren; this.nameChildren = nameChildren;
this.password = password; this.password = password;
} }
@ -38,10 +37,9 @@ public class User {
* *
* @return Phonenumber * @return Phonenumber
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
public String getPhonenumber() { public String getPhonenumber() {
return phonenumber; return phoneNumber;
} }
/** /**
@ -49,7 +47,6 @@ public class User {
* *
* @return password * @return password
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
public String getPassword() { public String getPassword() {
return password; return password;
@ -60,7 +57,6 @@ public class User {
* *
* @return nameParent1 * @return nameParent1
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
public String getNameParent1() { public String getNameParent1() {
return nameParent1; return nameParent1;
@ -71,7 +67,6 @@ public class User {
* *
* @return nameParent2 * @return nameParent2
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
public String getNameParent2() { public String getNameParent2() {
return nameParent2; return nameParent2;
@ -82,7 +77,6 @@ public class User {
* *
* @return a String with nameParent1, nameparent2, billAdress, phonenumber, nameChildren, password * @return a String with nameParent1, nameparent2, billAdress, phonenumber, nameChildren, password
* @author Madeleine Vigier * @author Madeleine Vigier
* @version 1.0
*/ */
@Override @Override
public String toString() { public String toString() {
@ -90,7 +84,7 @@ public class User {
"nameParent1='" + nameParent1 + '\'' + "nameParent1='" + nameParent1 + '\'' +
", nameParent2='" + nameParent2 + '\'' + ", nameParent2='" + nameParent2 + '\'' +
", billAddress='" + billAddress + '\'' + ", billAddress='" + billAddress + '\'' +
", phonenumber='" + phonenumber + '\'' + ", phonenumber='" + phoneNumber + '\'' +
", nameChildren='" + nameChildren + '\'' + ", nameChildren='" + nameChildren + '\'' +
", password='" + password + '\'' + ", password='" + password + '\'' +
'}'; '}';