Compare commits

..

53 Commits

Author SHA1 Message Date
51e370ad33 Quelle angepasst 2023-02-01 15:19:34 +01:00
f1fabad17d Java Doc 2023-02-01 15:19:12 +01:00
deeabfd2ad Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/Order.java
2023-02-01 12:42:34 +01:00
6ffc7a6868 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	out/production/VPR_SCRIPT/Data.class
#	out/production/VPR_SCRIPT/Execute.class
2023-02-01 12:42:23 +01:00
7e507fa95c General Methods gesäubert, Sicherungs Commit zur implementierung von PDF CLown 2023-01-23 08:50:32 +01:00
f35554f858 changeOrder methode ergänzt + test order files 2023-01-17 17:03:44 +01:00
9663777e25 Korrektur der writeData. 2023-01-17 16:43:28 +01:00
eeba57165b Merge remote-tracking branch 'origin/master' 2023-01-17 16:38:16 +01:00
58ec030102 Korrektur der Syntax und einhaltliche toString für das Speichern der Daten. 2023-01-17 16:37:39 +01:00
4baa3ef51b Merge remote-tracking branch 'origin/master' 2023-01-17 16:16:13 +01:00
a44c87cf83 isEmpty Abfrage entfernt und in validData Methode hinzugefügt 2023-01-17 16:15:58 +01:00
230202aa0a Merge remote-tracking branch 'origin/master' 2023-01-17 16:10:07 +01:00
3df13417c7 Korrektur der Syntax und einhaltliche toString für das Speichern der Daten. 2023-01-17 16:09:55 +01:00
d4a351a4e2 Merge remote-tracking branch 'origin/master' 2023-01-17 16:02:39 +01:00
83af3a6066 Regex in validateData geändert 2023-01-17 16:02:29 +01:00
d2f9ef49c9 Korrektur der Syntax und einhaltliche toString für das Speichern der Daten. 2023-01-17 15:43:56 +01:00
d858ff8f8d Methode validateData ergänzt 2023-01-16 16:53:30 +01:00
95069e7d8d to String Oder Class in Kommantar 2023-01-16 16:05:15 +01:00
3c51ebbc21 Order Klasse korrigiert & kommentiert 2023-01-12 12:20:24 +01:00
644df46a7a Order Klasse angepasst, sowie readOrder angepasst 2023-01-10 16:23:10 +01:00
19d36d3464 Order Klasse gefüllt, sowie readOrder Datentypen angepasst 2023-01-10 15:59:16 +01:00
12a8806fb6 Login ist jetzt auf english und kommentare wurden ergänzt. 2022-12-21 17:01:06 +01:00
de77901f5a Login aktualisiert! 2022-12-21 08:28:06 +01:00
76d08d93da Login ist so gut wie fertig! 2022-12-20 19:41:12 +01:00
2d683b9cc6 Login ergänzt 2022-12-20 19:12:54 +01:00
739e973cf7 Merge remote-tracking branch 'origin/master' 2022-12-20 19:10:13 +01:00
044f64635b Korrektur der Syntax und Überabeitung der Kommentare 2022-12-19 15:28:14 +01:00
487bdd8fe0 Merge remote-tracking branch 'origin/master' 2022-12-19 10:07:47 +01:00
c526229de9 users.txt wurde richtig im dateipfad positioniert 2022-12-19 10:07:05 +01:00
93bf389472 txt angepasst 2022-12-18 11:48:51 +01:00
1b73582469 kommentare angepasst 2022-12-18 08:47:47 +01:00
ad6c4dec56 kommentare angepasst 2022-12-18 08:45:25 +01:00
0b119f6637 quelle ergänzt 2022-12-18 07:53:31 +01:00
16ab1705f0 code bereinigt 2022-12-18 07:49:33 +01:00
6d690410ec Kommentare angepasst 2022-12-18 07:49:06 +01:00
922345077b code bereinigt 2022-12-18 07:48:42 +01:00
455e92a986 bla 2022-12-17 17:30:43 +01:00
7d2b03d584 toString() angepasst 2022-12-17 17:30:04 +01:00
27b2186c87 Tagname aus Datum erzeugt 2022-12-17 17:29:42 +01:00
bf8cf182db ausgabe angepasst 2022-12-17 17:28:35 +01:00
536d7fe1fb 15.12/16.12 ergänzt 2022-12-17 17:28:18 +01:00
4b51db302e Legenede ingredients hinzugefügt 2022-12-17 13:33:23 +01:00
5f0191d6cd Klasse ingredients gekürzt in List 2022-12-17 13:32:41 +01:00
61ba486e4f txt angepasst 2022-12-17 13:31:35 +01:00
eb249cb685 readMenue() List<>ingredients hinzugefügt 2022-12-17 13:31:21 +01:00
6f1b665c4c getTyp() angepasst 2022-12-16 09:13:18 +01:00
97a83dcc46 Kommentare angepasst 2022-12-16 08:55:06 +01:00
3a2e57d039 toString() angepasst 2022-12-16 08:40:05 +01:00
84ded9963a toString() angepasst 2022-12-16 08:37:51 +01:00
3d283c95cd menue.txt (in Bearbeitung) 2022-12-16 08:37:27 +01:00
a38bd2b59f menue methode angepasst 2022-12-15 20:03:06 +01:00
1bc6ecd05e menue methode angepasst 2022-12-15 19:38:36 +01:00
97686d48ca menue methode angepasst 2022-12-15 19:38:24 +01:00
19 changed files with 748 additions and 600 deletions

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

124
.idea/uiDesigner.xml generated Normal file
View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@@ -1,14 +1,20 @@
12.12.2022;Veganes Schnitzel;mit Kroketten, Gemüse und Soße;Vegan;;x;;;x;;;;;;x;;;;;;;;;;;
12.12.2022;Waffel;mit Puderzucker;Dessert V;;;;;x;;;;;;;;x;;;;;;x;;;
12.12.2022;Schnitzel;mit Kroketten, Gemüse und Soße;Fleisch;;;;;x;;;;;x;;;;x;;;;;;;;
12.12.2022;Wackelpudding;mit Vanillesoße;Dessert;;;;;;;;;;;;;;;x;;;;;;;
13.12.2022;Rote Linsen Curry;mit Süßkartoffeln;Vegan;;x;;x;;;;;x;;;x;;;;;;;;;;
13.12.2022;Vegane Pancakes;mit Ahornsirup;Dessert V;;x;;x;;;;;x;;;x;;;x;;;;;;;
13.12.2022;Gebratene Nudeln;mit Gemüse;Vegetarisch;;;;;;;;;x;;;;x;;;x;;x;;;;
13.12.2022;Berliner;;Dessert;;;;;;;;;;;;;;;;;;;;;;
14.12.2022;Bratkartoffeln;mit veganer Bratensoße;Vegan;;;;;;;;;;;;;;;;;;;;;;
14.12.2022;Pudding;;Dessert V;;;;;;;;;;;;;;;;;;;;;;
14.12.2022;Bratkartoffeln;mit Leberkäse und Ei;Fleisch;;;;;;;;;;;;;;;;;;;;;;
14.12.2022;Pudding;mit Vanillesoße;Dessert;;;;;;;;;;;;;;;;;;;;;;;
15.12.2022;Bauerntopf;mit veganem Hack;Vegan;;;;;;;;;;;;;;;;;;;;;;
15.12.2022;Bananenbrot;mit Datteln;DessertV;x;;;;;;;;;;;;;;;;;;;;;
12.12.2022;Veganes Schnitzel;mit Kroketten und Gemüse;Vegan;x;;;;;;x;;;;x;;;;;;;x;;;;;x
12.12.2022;Vegane Waffel;mit Puderzucker;Dessert V;;;x;;x;;;;;x;;;;;;;x;;;;;;x
12.12.2022;Schnitzel;mit Kroketten, Gemüse und Soße;Fleisch;;;x;;;;;x;;;x;;;;;;;;x;;;;x
12.12.2022;Wackelpudding;mit Vanillesoße;Dessert;;;x;;;;;x;;;;;;;;x;;;;;x;;x
13.12.2022;Rote Linsen Curry;mit Süßkartoffeln;Vegan;;;x;;;;;;;;x;;;;;;x;;;;;;x
13.12.2022;Vegane Pancakes;mit Ahornsirup;Dessert V;x;;;;x;;;;x;;;;;x;;;;;;;;;x
13.12.2022;Gebratene Nudeln;mit Gemüse;Vegetarisch;;;;;;x;;;x;;x;;x;;;x;;;;;;;x
13.12.2022;Berliner;mit Erdbeerfüllung;Dessert;;;x;;;x;;;;x;;;;;x;;;;;x;;;x
14.12.2022;Bratkartoffeln;mit veganer Bratensoße;Vegan;;x;;;;x;;;;;;x;;;;;x;;;;;;x
14.12.2022;Pudding;mit Schokostreuseln;Dessert V;x;;x;;;x;;;x;;;;;;;x;;;;;;;x
14.12.2022;Bratkartoffeln;mit Leberkäse und Ei;Fleisch;;;;x;;x;;;x;;;;x;;;;;;;;;;x
14.12.2022;Pudding;mit Vanillesoße;Dessert;;;x;;;x;;x;;;x;;;;;;x;;;;;;x
15.12.2022;Bauerntopf;mit veganem Hack;Vegan;;x;;;;;;;;;x;;;;x;;;;x;;;;x
15.12.2022;Bananenbrot;mit Datteln;DessertV;;;x;;;x;;;;x;;;;;x;;;;;;;;x
15.12.2022;Bauerntopf;mit veganem Hack;Vegan;;x;;;;;;;;;x;;;;x;;;;x;;;;x
15.12.2022;Bananenbrot;mit Datteln;DessertV;;;x;;;x;;;;x;;;;;x;;;;;;;;x
16.12.2022;Bauerntopf;mit veganem Hack;Vegan;;x;;;;;;;;;x;;;;x;;;;x;;;;x
16.12.2022;Bananenbrot;mit Datteln;DessertV;;;x;;;x;;;;x;;;;;x;;;;;;;;x
16.12.2022;Bauerntopf;mit veganem Hack;Vegan;;x;;;;;;;;;x;;;;x;;;;x;;;;x
16.12.2022;Bananenbrot;mit Datteln;DessertV;;;x;;;x;;;;x;;;;;x;;;;;;;;x

12
orders.txt Normal file
View File

@@ -0,0 +1,12 @@
12.12.2022;1234567;Vegan;Dessert V
12.12.2022;7654321;Vegan;Dessert V
12.12.2022;123;Vegetarisch;Dessert V
12.12.2022;9999999;Fleisch;Dessert
12.12.2022;1234567;Vegan;Dessert V
12.12.2022;7654321;Vegan;Dessert V
12.12.2022;123;Vegetarisch;Dessert V
12.12.2022;9999999;Fleisch;Dessert
12.12.2022;1234567;Vegan;Dessert V
12.12.2022;7654321;Vegan;Dessert V
12.12.2022;123;Vegetarisch;Dessert V
12.12.2022;1234;Fleisch;Dessert

12
orders2.txt Normal file
View File

@@ -0,0 +1,12 @@
12.12.2022;1234567;Vegan;Dessert V
12.12.2022;7654321;Vegan;Dessert V
12.12.2022;123;Vegetarisch;Dessert V
12.12.2022;9999999;Fleisch;Dessert
12.12.2022;1234567;Vegan;Dessert V
12.12.2022;7654321;Vegan;Dessert V
12.12.2022;123;Vegetarisch;Dessert V
12.12.2022;9999999;Fleisch;Dessert
12.12.2022;1234567;Vegan;Dessert V
12.12.2022;7654321;Vegan;Dessert V
12.12.2022;123;Vegetarisch;Dessert V
12.12.2022;1234;Fleisch;Dessert

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,12 +1,18 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Data is a class to edit files.
*
* @author Madeleine Vigier
* @version 1.3
*/
@@ -16,13 +22,14 @@ public class Data {
public Data(String pathRead) {
this.pathRead = pathRead;
}
/**
* readUser() is a method to split user.txt into lines and save them in an arraylist
*
* @return Arraylist userList
* @author Madeleine Vigier, Sabine Gubitz
* @version 1.3
*/
public ArrayList<User> readUser(){
public ArrayList<User> readUser() {
List<String> rows = getRows();
ArrayList<User> userList = new ArrayList<>();
@@ -35,204 +42,196 @@ public class Data {
String phonenumber = parts[3];
String nameChildren = parts[4];
String password = parts[5];
userList.add(new User(nameParent1,nameParent2,billAddress,phonenumber,nameChildren,password));
userList.add(new User(nameParent1, nameParent2, billAddress, phonenumber, nameChildren, password));
}
return userList;
}
/**
* readMenue() is a method to split menue.txt into lines and save them in an arraylist
*
* @return Arraylist menuelist
* @author Madeleine Vigier, Sabine Gubitz
* @version 1.3
*/
public ArrayList<Menue> readMenue(){
ArrayList<Menue> menueList = new ArrayList<>();
public ArrayList<Menu> readMenu() {
List<String> rows = getRows();
ArrayList<Menu> menuList = new ArrayList<>();
for (String row : rows) {
String[] parts = row.split(";");
String date = parts[1];
String dish = parts[2];
String sideDish = parts[3];
String typ = parts[4];
String desertV = parts[5];
String desert = parts[6];
String allergens = parts[7];
String date = parts[0];
String dish = parts[1];
String sideDish = parts[2];
String typ = parts[3];
String ingredient = parts[4];
boolean eggs = false;
if (allergens != "") {
eggs = true;
}
allergens = parts[8];
boolean peanuts = false;
if (allergens != "") {
peanuts = true;
}
allergens = parts[9];
boolean fish = false;
if (allergens != "") {
fish = true;
}
allergens = parts[10];
boolean grains = false;
if (allergens != "") {
grains = true;
}
allergens = parts[11];
boolean crustaceans = false;
if (allergens != "") {
crustaceans = true;
}
allergens = parts[12];
boolean lupines = false;
if (allergens != "") {
lupines = true;
}
allergens = parts[13];
boolean milk = false;
if (allergens != "") {
milk = true;
}
allergens = parts[14];
boolean nuts = false;
if (allergens != "") {
nuts = true;
}
allergens = parts[15];
boolean sulfurDioxideAndSulfite = false;
if (allergens != "") {
sulfurDioxideAndSulfite = true;
}
allergens = parts[16];
boolean celeriac = false;
if (allergens != "") {
celeriac = true;
}
allergens = parts[17];
boolean mustards = false;
if (allergens != "") {
mustards = true;
}
allergens = parts[18];
boolean sesame = false;
if (allergens != "") {
sesame = true;
}
allergens = parts[19];
boolean soy = false;
if (allergens != "") {
soy = true;
}
allergens = parts[20];
boolean molluscs = false;
if (allergens != "") {
molluscs = true;
}
String additives = parts[21];
boolean antioxidant = false;
if (additives != "") {
antioxidant = true;
}
additives = parts[22];
boolean artificialColours = false;
if (additives != "") {
artificialColours = true;
}
additives = parts[23];
boolean flavourEnhancer = false;
if (additives != "") {
flavourEnhancer = true;
}
additives = parts[24];
boolean preservatives = false;
if (additives != "") {
preservatives = true;
}
additives = parts[25];
boolean nitrate = false;
if (additives != "") {
nitrate = true;
}
additives = parts[26];
boolean picklingSalt = false;
if (additives != "") {
picklingSalt = true;
}
additives = parts[27];
boolean phosphate = false;
if (additives != "") {
phosphate = true;
}
additives = parts[28];
boolean artificialSweetener = false;
if (additives != "") {
artificialSweetener = true;
List<String> ingredients = new ArrayList<>();
if (!ingredient.isEmpty()) {
ingredients.add("a"); //eggs
}
menueList.add(new Menue(date, dish, sideDish, typ, desertV, desert, eggs, peanuts, fish, grains,
crustaceans, lupines, milk, nuts, sulfurDioxideAndSulfite, celeriac, mustards, sesame,
soy, molluscs, antioxidant, artificialColours, flavourEnhancer, preservatives, nitrate,
picklingSalt, phosphate, artificialSweetener));
ingredient = parts[5];
if (!ingredient.isEmpty()) {
ingredients.add("d"); //peanuts
}
ingredient = parts[6];
if (!ingredient.isEmpty()) {
ingredients.add("m"); //fish
}
ingredient = parts[7];
if (!ingredient.isEmpty()) {
ingredients.add("g"); //grains
}
ingredient = parts[8];
if (!ingredient.isEmpty()) {
ingredients.add("f"); //crustaceans
}
ingredient = parts[9];
if (!ingredient.isEmpty()) {
ingredients.add("n"); //lupines
}
ingredient = parts[10];
if (!ingredient.isEmpty()) {
ingredients.add("c"); //milk
}
ingredient = parts[11];
if (!ingredient.isEmpty()) {
ingredients.add("k"); //nuts
}
ingredient = parts[12];
if (!ingredient.isEmpty()) {
ingredients.add("j"); //sulfurDioxideAndSulfite
}
ingredient = parts[13];
if (!ingredient.isEmpty()) {
ingredients.add("l"); //celeriac
}
ingredient = parts[14];
if (!ingredient.isEmpty()) {
ingredients.add("h"); //mustards
}
ingredient = parts[15];
if (!ingredient.isEmpty()) {
ingredients.add("i"); //sesame
}
ingredient = parts[16];
if (!ingredient.isEmpty()) {
ingredients.add("b");//soy
}
ingredient = parts[17];
if (!ingredient.isEmpty()) {
ingredients.add("e");//molluscs
}
ingredient = parts[18];
if (!ingredient.isEmpty()) {
ingredients.add("4"); //antioxidant
}
ingredient = parts[19];
if (!ingredient.isEmpty()) {
ingredients.add("5");
}
ingredient = parts[20];
if (!ingredient.isEmpty()) {
ingredients.add("6"); //flavourEnhancer
}
ingredient = parts[21];
if (!ingredient.isEmpty()) {
ingredients.add("8"); // preservatives
}
ingredient = parts[22];
if (!ingredient.isEmpty()) {
ingredients.add("3"); //nitrate
}
ingredient = parts[23];
if (!ingredient.isEmpty()) {
ingredients.add("1");//picklingSalt
}
ingredient = parts[24];
if (!ingredient.isEmpty()) {
ingredients.add("7"); //artificialSweetener
}
ingredient = parts[25];
if (!ingredient.isEmpty()) {
ingredients.add("2"); //phosphate
}
String end = parts[26]; //endpoint
menuList.add(new Menu(date, dish, sideDish, typ, ingredients));
}
return menueList;
return menuList;
}
/**
* readOrder() is a method to split order.txt into lines and save them in an arraylist
*
* @return Arraylist orderlist
* @author Madeleine Vigier, Sabine Gubitz
* @version 1.2
*/
public ArrayList<Order> readOrder(){
public ArrayList<Order> readOrder() {
ArrayList<String> orderList = new ArrayList<>();
ArrayList<Order> orderList = new ArrayList<>();
List<String> rows = getRows();
for (String row : rows) {
String[] parts = row.split(";");
for (String row : rows) {
String[] parts = row.split(";");
String date = parts[0];
String meat = parts[1];
String meatCount = parts[2];
String vegi = parts[3];
String vegiCount = parts[4];
String vegan = parts[5];
String veganCount = parts[6];
String desertV = parts[7];
String desertVCount = 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))
}
return null;//orderList
String date = parts[0];
String user = parts[1];
String mealtype = parts[3];
String deserttype = parts[5];
orderList.add(new Order(date, user, mealtype, deserttype));
}
return null;//orderList
}
/**
* The method writeData writes the data of a List into a txt file.
* @param pathWrite determines the filename of the file that will be written
*
* @author Felix Wöstemeyer
*
* @param pathWrite determines the filename of the file that will be written
* @param listToWrite determines which ArrayList is to be used for writing the file
*/
public void writeData(String pathWrite, ArrayList<String> listToWrite){
if (pathWrite.equals("users.txt")) {
} else if (pathWrite.equals("orders.txt")) {
public void writeData(String pathWrite, ArrayList<String> listToWrite) {
try {
if (new File(pathWrite).exists()) {
for (String zeile : listToWrite) {
new FileWriter(pathWrite).write(zeile);
}
}else
{
Scanner scanner = new Scanner(System.in);
System.out.println("Der Pfad oder die Datei "+ pathWrite +" existiert nicht!\nMöchten Sie unter dem Pfad "+ pathWrite+ " eine neue Datei erstellen? (Y/N)");
if(scanner.nextLine().equals("Y")){
new File(pathWrite).createNewFile();
System.out.println("Die Datei "+ pathWrite+" wurde erfolgreich erstellt");
}else if(!scanner.nextLine().equals("N") && !scanner.nextLine().equals("Y")){
System.out.println("Es ist ein Fehler mit ihrer Antwort aufgetreten!");
}
}
}catch(IOException e){
e.printStackTrace();
}
}
/**
* The method gets the rows by reading all lines of the path
*
* @return ArrayList rows
* @author Madeleine Vigier
* @version 1.0
*/
private List<String> getRows() {
Path path = Paths.get(pathRead);
@@ -244,5 +243,120 @@ public class Data {
}
return rows;
}
/**
* The method validates the user input
*
* @return boolean inputValid
* @author Kevin Maier
*/
private boolean validateData(String password, String phoneNumber)
{
boolean inputValid = false;
boolean phoneNumberMatchFound;
boolean passwordMatchFound;
boolean phoneNumberValid = false;
boolean passwordValid = false;
Pattern phoneNumberPattern = Pattern.compile("[0-9]*");
Pattern passwordPattern = Pattern.compile("^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$");
Scanner reader = new Scanner(System.in);
while(password.isEmpty() || phoneNumber.isEmpty())
{
System.out.println("Login fehlgeschlagen. Eingabe ist leer, versuchen Sie es erneut.");
System.out.println("");
System.out.print("Telefonnummer: ");
phoneNumber = reader.nextLine();
System.out.print("Passwort: ");
password = reader.nextLine();
}
Matcher phoneNumberMatcher = phoneNumberPattern.matcher(phoneNumber);
Matcher passwordMatcher = passwordPattern.matcher(password);
phoneNumberMatchFound = phoneNumberMatcher.find();
passwordMatchFound = passwordMatcher.find();
while (!inputValid) {
if (!phoneNumberMatchFound || phoneNumber.length() != 15) {
System.out.println("Login fehlgeschlagen. Die eingegebene Handynummer ist nicht valide.");
System.out.println("");
System.out.print("Telefonnummer: ");
phoneNumber = reader.nextLine();
System.out.print("Passwort: ");
password = reader.nextLine();
} else {
phoneNumberValid = true;
}
if (!passwordMatchFound || password.length() < 6 || password.length() > 20) {
System.out.println("Login fehlgeschlagen. Das eingegebene Passwort ist nicht valide.");
System.out.println("");
System.out.print("Telefonnummer: ");
phoneNumber = reader.nextLine();
System.out.print("Passwort: ");
password = reader.nextLine();
} else {
passwordValid = true;
}
if (phoneNumberValid && passwordValid) {
inputValid = true;
}
}
return inputValid;
}
/**
* The method changes the orders.txt file by removing canceled orders
*
* @return ArrayList\<Order> changedOrderList
* @author Felix Düsterhaus
*/
public ArrayList<Order> changeOrder(String userLogin) {
/*
File orderFile = new File("C:/Unterricht/VPR/orders.txt");
if (orderFile.delete()) {
System.out.println("Datei gelöscht: " + orderFile.getName());
} else {
System.out.println("Fehler, " + orderFile.getName() + " nicht gelöscht.");
}
*/
ArrayList<Order> changedOrderList = new ArrayList<>();
List<String> rows = getRows();
int changedEntries = 0;
for (String row : rows) {
String[] parts = row.split(";");
String date = parts[0];
String user = parts[1];
String mealtyp = parts[2];
String deserttyp = parts[3];
if(!userLogin.equals(user)) {
changedOrderList.add(new Order(date, user, mealtyp, deserttyp));
} else {
changedEntries++;
}
}
try {
FileWriter writer = new FileWriter("orders2.txt");
for(Order str: changedOrderList) {
writer.write(str + System.lineSeparator());
}
writer.close();
System.out.println("Daten gelöscht");
System.out.println(changedEntries + " Einträge entfernt.");
} catch (IOException e) {
e.printStackTrace();
}
return changedOrderList;
}
}

View File

@@ -1,3 +1,5 @@
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Scanner;
@@ -5,68 +7,69 @@ import java.util.Scanner;
* The class Execute is the execution file for the whole program.
*/
public class Execute {
public static void main(String[] args) {
public static void main(String[] args) throws IOException {
//EXECUTE MENU OVERVIEW
Data data = new Data("menue.txt");
ArrayList<Menu> menu = data.readMenu();
ArrayList<Menue> menue = data.readMenue();
for (Menue m : menue) {
System.out.println(m);
for (int i = 0; i < menu.size(); i++) {
if (i % 4 == 0) {
System.out.println();
System.out.println("--------------------------------------");
System.out.println(GeneralMethods.getDayNumberNew(menu.get(i).getDate()));
System.out.println(menu.get(i).getDate());
System.out.println();
}
System.out.println(menu.get(i));
}
}
// Data datei = new Data("users.txt");
// ArrayList<User> user = datei.readUser();
//
// for (User user1 : user) {
// System.out.println(user1);
// }
// System.out.println();
// System.out.println("\t\t\tANMELDUNG");
// int i = 0;
// Scanner leser = new Scanner(System.in);
//
// while (true) {
//
//
// System.out.print("Name: ");
// boolean error = false;
// String name = leser.nextLine();
// error = isError(error, name);
// System.out.print("Passwort: ");
// String password = leser.nextLine();
// error = isError(error, password);
//
//
// for (User user1 : user) {
// if (!error) {
// if (user1.getPassword().equals(password) && user1.getPhonenumber().equals(name)) {
// System.out.println();
// System.out.println("Herzlich Willkommen " + user1.getNameParent1() + " und " + user1.getNameParent2() + ", Ihr Login war erfolgreich!");
//
// i++;
// break;
//
// } else if (!(user1.getPassword().equals(password) && user1.getPhonenumber().equals(name))) {
// System.out.println("Login fehlgeschlagen. Versuchen Sie es erneut.");
// break;
// }
//
// }else{
// System.out.println("Bitte Anmeldedaten angeben.");
// break;
// }
// }
// if (i > 0) {
// break;
// }
// }
// }
private static boolean isError(boolean error, String name) {
if (name.isEmpty()) {
error = true;
System.out.println("a: Eier; b: Soja, c: Milch; d: Erdnüsse; e: Weichtiere; f: Krebstiere; g: Getreide; h: Senf\n"
+ "i: Sesam; j: Schwefeldioxid und Sulfit; k: Nüsse; l: Sellerie; m: Fische; n: Lupinen\n"
+ "1: Nitrit-Pökelsalz; 2: Phosphat; 3: Nitrat; 4: Antioxidationsmittel; 5: Farbstoff;\n"
+ "6: Geschmacksverstärker; 7: Süßungsmittel; 8: Konservierungsstoff");
/**
* In the Login-Area the user can type the phonenumber and the password to login.
* In the Background, the class Login checks the input and return whether the login was correct or not.
*
* @author Kevin Pfannenstiel
*/
System.out.println("");
System.out.println("____________________________LOGIN_______________________________");
Data userData = new Data("user.txt");
Login login = new Login();
Scanner leser = new Scanner(System.in);
System.out.println("");
System.out.println("Bitte einloggen");
System.out.print("Telefonnummer: ");
String phoneNumber = leser.nextLine();
System.out.print("Passwort: ");
String password = leser.nextLine();
login.toLogin(userData.readUser(), password, phoneNumber);
/**
* Test zum Daten löschen
* @author Felix Düsterhaus
*/
Data orderData = new Data("orders2.txt");
System.out.print("Möchten Sie Einträge löschen? (Y/N) ");
String orderChangeDecision = leser.nextLine();
if (orderChangeDecision.equals("Y") || orderChangeDecision.equals("y")) {
ArrayList<Order> changedOrderList = orderData.changeOrder(phoneNumber);
} else if (orderChangeDecision.equals("N") || orderChangeDecision.equals("n")) {
System.out.println("Daten werden nicht geändert.");
}
while(!(orderChangeDecision.equals("Y") || orderChangeDecision.equals("y") || orderChangeDecision.equals("N") || orderChangeDecision.equals("n"))) {
System.out.println("Bitte eine gültige Aussage treffen.\n");
System.out.print("Möchten Sie Einträge löschen? (Y/N) ");
orderChangeDecision = leser.nextLine();
if (orderChangeDecision.equals("Y") || orderChangeDecision.equals("y")) {
ArrayList<Order> changedOrderList = orderData.changeOrder(phoneNumber);
} else if (orderChangeDecision.equals("N") || orderChangeDecision.equals("n")) {
System.out.println("Daten werden nicht geändert.");
}
}
return error;
}
}

View File

@@ -1,123 +1,58 @@
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
/**GeneralMethods is a class for commen public methods.
/**
* GeneralMethods is a class for commen public methods.
*
* @auhtor Felix Wöstemeyer
*
* @version 1.0
* @author Felix Wöstemeyer
* @version 1.4
*/
public class GeneralMethods {
/**The method writeData saves the given data to a certain file.
/**
* The method getDayNumberNew() gets the Number of day in week
*
* @param pathWrite the given filepath to write
* @param data the data to be saved
* @param dateString date as String e.g. 12.12.2022
* @return the Number of day in week
* @author Madeleine Vigier
*/
public static void writeData(String pathWrite, ArrayList<String> data){
try{
BufferedWriter writer = new BufferedWriter(new FileWriter(pathWrite));
for (String d : data) {
writer.write(d);
writer.newLine();
}
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
public static String getDayNumberNew(String dateString) {
//https://stackoverflow.com/questions/8746084/string-to-localdate
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy");
formatter = formatter.withLocale(Locale.GERMANY); // Locale specifies human language for translating, and cultural norms for lowercase/uppercase and abbreviations and such. Example: Locale.US or Locale.CANADA_FRENCH
LocalDate date = LocalDate.parse(dateString, formatter);
DayOfWeek day = date.getDayOfWeek();
return getDayName(day.getValue());
}
/**
* Author: Sabine Gubitz
*ddd
* The method read Data interprets a file and returns an useable list for other methods.
* Files to be read have to use : as a divider between attributes
* The method getDayName() gets the weekday
*
* @param pathRead determines the filename of the file that will be read
* @return menueList, userList, orderList depending on Data read
* @param dayNumber dayNumber e.g. 1 for Monday
* @return String weekday
* @author Madeleine Vigier
*/
public static ArrayList<String> readData(String pathRead) {
Path path = Paths.get(pathRead);
try {
List<String> rows = Files.readAllLines(path);
if (pathRead.equals("menue.txt")) {
ArrayList<String> menueList = new ArrayList<>();
for (String row : rows) {
String[] parts = row.split(":");
String day = parts[0];
String date = parts[1];
String meat = parts[2];
String vegi = parts[3];
String vegan = parts[4];
String desert1 = parts[5];
String desert2 = parts[6];
menueList.add(day + "," + date + "," + meat + "," + vegi + "," + vegan + "," + desert1 + "," + desert2);
}
return menueList;
} else if (pathRead.equals("users.txt")){
ArrayList<String> userList = new ArrayList<>();
for (String row : rows) {
String[] parts = row.split(":");
String nameParent1 = parts[0];
String nameParent2 = parts[1];
String billAddress = parts[2];
String phonenumber = parts[3];
String nameChildren = parts[4];
String password = parts[5];
}
return userList;
} else if (pathRead.equals("orders.txt")) {
ArrayList<String> orderList = new ArrayList<>();
for (String row : rows) {
String[] parts = row.split(":");
String date = parts[0];
String meat = parts[1];
String meatCount = parts[2];
String vegi = parts[3];
String vegiCount = parts[4];
String vegan = parts[5];
String veganCount = parts[6];
String desert1 = parts[7];
String desert1Count = parts[8];
String desert2 = parts[9];
String desert2Count = parts[10];
}
return orderList;
}
} catch (IOException e) {
e.printStackTrace();
public static String getDayName(int dayNumber) {
if (dayNumber == 1) {
return "Montag";
}
if (dayNumber == 2) {
return "Dienstag";
}
if (dayNumber == 3) {
return "Mittwoch";
}
if (dayNumber == 4) {
return "Donnerstag";
}
if (dayNumber == 5) {
return "Freitag";
}
return null;
}
/**
* The method writeData2 writes the data of a List into a txt file.
* @param pathWrite determines the filename of the file that will be written
* @param listToWrite determines which ArrayList is to be used for writing the file
*/
public void writeData2 (String pathWrite, ArrayList<String> listToWrite){
if (pathWrite.equals("users.txt")) {
} else if (pathWrite.equals("orders.txt")) {
}
}
}

69
src/Login.java Normal file
View File

@@ -0,0 +1,69 @@
import java.util.ArrayList;
import java.util.Scanner;
public class Login {
/**
* The method toLogin() compares the phonenumber and password of the user with the phonenumber and password
* from the user.txt
*
* @param user all users are in a list
* @param password password of the user
* @param phoneNumber phonenumber of the user
* @return void
* @author Kevin Pfannenstiel
*/
public void toLogin(ArrayList<User> user, String password, String phoneNumber) {
Scanner leser = new Scanner(System.in);
System.out.println();
int i = 0;
while (true) {
boolean error = false;
error = isError(error, phoneNumber);
for (User user1 : user) {
if (!error) {
if (user1.getPassword().equals(password) && user1.getPhonenumber().equals(phoneNumber)) {
System.out.println("");
System.out.println("\t\t\tANMELDUNG");
System.out.println();
System.out.println("Herzlich Willkommen " + user1.getNameParent1() + " und " + user1.getNameParent2() + ", Ihr Login war erfolgreich!");
i++;
break;
}
else if (!(user1.getPassword().equals(password) && user1.getPhonenumber().equals(phoneNumber))) {
System.out.println("Login fehlgeschlagen. Versuchen Sie es erneut.");
System.out.println("");
System.out.print("Telefonnummer: ");
phoneNumber = leser.nextLine();
System.out.print("Passwort: ");
password = leser.nextLine();
break;
}
}
}
if (i > 0) {
break;
}
}
}
/**
* The method getDayNumberNew() checks if the phonenumber-input is empty.
*
* @param error is a boolean
* @param phoneNumber is the input of the user
* @return the boolean error
* @author Madeleine Vigier
*/
public boolean isError(boolean error, String phoneNumber) {
if (phoneNumber.isEmpty()) {
error = true;
}
return error;
}
}

71
src/Menu.java Normal file
View File

@@ -0,0 +1,71 @@
import java.util.List;
/**
* Menu is a class to built a menu
*
* @author Madeleine Vigier
* @version 1.1
*/
public class Menu {
String date;
String dish;
String sideDish;
String type;
List<String> ingredients;
/**
* constructor
*
* @param date date of meal
* @param dish meal
* @param sideDish side dish
* @param type vegan, vegetarian or meat
* @param ingredients list of ingredients
*/
public Menu(String date, String dish, String sideDish, String type, List<String> ingredients) {
this.date = date;
this.dish = dish;
this.sideDish = sideDish;
this.type = type;
this.ingredients = ingredients;
}
/**
* The method get Date() gets the date
*
* @return date
* @author Madeleine Vigier
*/
public String getDate() {
return date;
}
/**
* The method getTyp() gets the typ of the meal
*
* @return typ e.g. Vegan
* @author Madeleine Vigier
*/
public String getType() {
if (type.contains("DessertV") || type.contains("Dessert")) {
return "";
} else {
return type;
}
}
/**
* The method toString() returns a String formated to save in a File
*
* @return a String with dish, sideDish, list of ingredients and the typ of the menu
* @author Madeleine Vigier, Felix Wöstemeyer
*/
@Override
public String toString() {
return date+";"+dish+";"+sideDish+";"+type+";"+ingredients;
}
}

View File

@@ -1,227 +0,0 @@
/**
* Menue is a class to built a menue
*
* @author: Madeleine Vigier
* @version: 1.0
*/
public class Menue {
String date;
String dish;
String sideDish;
String typ;
boolean eggs;
boolean peanuts;
boolean fish;
boolean grains;
boolean crustaceans;
boolean lupines;
boolean milk;
boolean nuts;
boolean sulfurDioxideAndSulfite;
boolean celeriac;
boolean mustards;
boolean sesame;
boolean soy;
boolean molluscs;
boolean antioxidant;
boolean artificialColours;
boolean flavourEnhancer;
boolean preservatives;
boolean nitrate;
boolean picklingSalt;
boolean phosphate;
boolean artificialSweetener;
/**
* constructor
*
* @param date date of meal
* @param dish meal
* @param sideDish side dish
* @param typ vegan, vegetarian or meat
* @param eggs allergens
* @param peanuts allergens
* @param fish allergens
* @param grains allergens
* @param crustaceans allergens
* @param lupines allergens
* @param milk allergens
* @param nuts allergens
* @param sulfurDioxideAndSulfite additives
* @param celeriac additives
* @param mustards additives
* @param sesame additives
* @param soy additives
* @param molluscs additives
* @param antioxidant additives
* @param artificialColours additives
* @param flavourEnhancer additives
* @param preservatives additives
* @param nitrate additives
* @param picklingSalt additives
* @param phosphate additives
* @param artificialSweetener additives
*/
public Menue(String date, String dish, String sideDish, String typ, boolean eggs, boolean peanuts, boolean fish, boolean grains, boolean crustaceans, boolean lupines, boolean milk, boolean nuts, boolean sulfurDioxideAndSulfite, boolean celeriac, boolean mustards, boolean sesame, boolean soy, boolean molluscs, boolean antioxidant, boolean artificialColours, boolean flavourEnhancer, boolean preservatives, boolean nitrate, boolean picklingSalt, boolean phosphate, boolean artificialSweetener) {
this.date = date;
this.dish = dish;
this.sideDish = sideDish;
this.typ = typ;
this.eggs = eggs;
this.peanuts = peanuts;
this.fish = fish;
this.grains = grains;
this.crustaceans = crustaceans;
this.lupines = lupines;
this.milk = milk;
this.nuts = nuts;
this.sulfurDioxideAndSulfite = sulfurDioxideAndSulfite;
this.celeriac = celeriac;
this.mustards = mustards;
this.sesame = sesame;
this.soy = soy;
this.molluscs = molluscs;
this.antioxidant = antioxidant;
this.artificialColours = artificialColours;
this.flavourEnhancer = flavourEnhancer;
this.preservatives = preservatives;
this.nitrate = nitrate;
this.picklingSalt = picklingSalt;
this.phosphate = phosphate;
this.artificialSweetener = artificialSweetener;
}
public String getDate() {
return date;
}
public String getDish() {
return dish;
}
public String getSideDish() {
return sideDish;
}
public String getTyp() {
if (typ.equals("DessertV") || typ.equals("Dessert")) {
return "";
} else {
return typ;
}
}
public String getEggs() {
if (eggs) {
return "a";
} else {
return "";
}
}
public String getPeanuts() {
if (peanuts) {
return "d";
} else {
return "";
}
}
public String getFish() {
if (fish) {
return "m";
} else {
return "";
}
}
public String getGrains() {
if (grains) {
return "a";
} else {
return "";
}
}
public boolean isCrustaceans() {
return crustaceans;
}
public boolean isLupines() {
return lupines;
}
public boolean isMilk() {
return milk;
}
public boolean isNuts() {
return nuts;
}
public boolean isSulfurDioxideAndSulfite() {
return sulfurDioxideAndSulfite;
}
public boolean isCeleriac() {
return celeriac;
}
public boolean isMustards() {
return mustards;
}
public boolean isSesame() {
return sesame;
}
public boolean isSoy() {
return soy;
}
public boolean isMolluscs() {
return molluscs;
}
public boolean isAntioxidant() {
return antioxidant;
}
public boolean isArtificialColours() {
return artificialColours;
}
public boolean isFlavourEnhancer() {
return flavourEnhancer;
}
public boolean isPreservatives() {
return preservatives;
}
public boolean isNitrate() {
return nitrate;
}
public boolean isPicklingSalt() {
return picklingSalt;
}
public boolean isPhosphate() {
return phosphate;
}
public boolean isArtificialSweetener() {
return artificialSweetener;
}
@Override
public String toString() {
return "Montag\n" + "\t\t\t\t" + dish + "\n" + sideDish
+ "Allergene" + "\n" + getTyp();
}
}

View File

@@ -1,2 +1,47 @@
import java.util.ArrayList;
/**
* The class Order is an object class that holds the constructor for order objects.
*
* @author Sabine Gubitz
* @version 1.2
*/
public class Order {
String date; //date for the meal, not the day it was ordered
String user; //phone number of the user account
String mealtype; //meat, vegi or vegan
String desserttype; //desert or vegan desert
Order (String date, String user, String mealtype, String desserttype)
{
this.date = date;
this.user = user;
this.mealtype = mealtype;
this.desserttype = desserttype;
}
@Override
public String toString(){
return date+";"+user+";"+mealtype+";"+desserttype;
}
/**
* The Method create PDF is used to create a PDF document of the daily orders as well as the bills for each user
*
* This Method uses PDF Clown, the source code can be found at http://www.pdfclown.org
* PDF Clown is covered by LGPL, a copy of the LGPL can be found withing the documentation
*
* @param pathWrite determines which document should be created
* @param listToWrite determines the list which is to be used to create the document
* @author Sabine Gubitz
*/
public void createPDF (String pathWrite, ArrayList<String> listToWrite) {
if (pathWrite.equals("users.pdf")) {
} else if (pathWrite.equals("bills.pdf")) {
}
}
}

View File

@@ -1,91 +1,85 @@
/**
* User class creates User Objects
*
* @author Madeleine Vigier
* @version 1.1
* @version 1.2
*/
public class User {
private String nameParent1;
private String nameParent2;
private String billAddress;
private String phonenumber;
private String phoneNumber;
private String nameChildren;
private String password;
/**
* constructor
* @param nameParent1
* @param nameParent2
* @param billAddress
* @param phonenumber
* @param nameChildren
* @param password
*
* @param nameParent1 name of the first parent of the child
* @param nameParent2 name of the second parent of the child
* @param billAddress the address the bill should be sent to
* @param phoneNumber phonenumber of one of the parents and also the username
* @param nameChildren name of the children
* @param password password of the user
* @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.nameParent2 = nameParent2;
this.billAddress = billAddress;
this.phonenumber = phonenumber;
this.phoneNumber = phoneNumber;
this.nameChildren = nameChildren;
this.password = password;
}
/**
* Methode getPhonenumber() gets the Phonenumber
* the method getPhonenumber() gets the Phonenumber
*
* @return Phonenumber
* @author Madeleine Vigier
* @version 1.0
*/
public String getPhonenumber() {
return phonenumber;
return phoneNumber;
}
/**
* Methode getPassword() gets the password
* the method getPassword() gets the password
*
* @return password
* @author Madeleine Vigier
* @version 1.0
*/
public String getPassword() {
return password;
}
/**
* Methode getNameParent1() gets nameParent1
* the method getNameParent1() gets nameParent1
*
* @return nameParent1
* @author Madeleine Vigier
* @version 1.0
*/
public String getNameParent1() {
return nameParent1;
}
/**
* Methode getNameParent2() gets nameParent2
* the method getNameParent2() gets nameParent2
*
* @return nameParent2
* @author Madeleine Vigier
* @version 1.0
*/
public String getNameParent2() {
return nameParent2;
}
/**
* Methode toString() returns a String representation of an object
* the methode toString() returns a String representation of an object
*
* @return a String with nameParent1, nameparent2, billAdress, phonenumber, nameChildren, password
* @author Madeleine Vigier
* @version 1.0
*/
@Override
public String toString() {
return "User{" +
"nameParent1='" + nameParent1 + '\'' +
", nameParent2='" + nameParent2 + '\'' +
", billAddress='" + billAddress + '\'' +
", phonenumber='" + phonenumber + '\'' +
", nameChildren='" + nameChildren + '\'' +
", password='" + password + '\'' +
'}';
return nameParent1 + ";" + nameParent2 + ";" + billAddress + ";" + phoneNumber + ";" + nameChildren + ";" + password;
}
}