-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDatas.java
53 lines (45 loc) · 1.29 KB
/
Datas.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package database;
/**
* class Datas.
* provides the methods the user can use
* to fill and print the existing deatas.
*/
public class Datas {
/**
* prints the existing datas.
*/
static void printData() {
if (!Fields.getFields().isEmpty()) {
fillTheData();
for (int i = 0; i < Fields.getFields().size(); i++) {
System.out.print(" ");
System.out.print(Fields.getFields().get(i));
System.out.print(" | ");
}
System.out.println();
CreateData.getValues().forEach((key, value) -> {
System.out.print("ID:" + key + "->");
System.out.print(value);
System.out.println();
});
System.out.println();
} else {
System.out.println("Empty database");
}
Database.menu();
}
/**
* fills the data.
*/
protected static void fillTheData() {
if (!(CreateData.getValues().isEmpty())) {
CreateData.getValues().forEach((key, value) -> {
if (!(value.size() == Fields.getFieldscounter())) {
do {
value.add("-");
} while (!(value.size() == Fields.getFieldscounter()));
}
});
}
}
}