-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotiz.java
More file actions
69 lines (54 loc) · 1.39 KB
/
Copy pathNotiz.java
File metadata and controls
69 lines (54 loc) · 1.39 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
public class Notiz {
private int id;
private int timestamp;
private Datum datum;
private Uhrzeit uhrzeit;
private String text;
public Notiz(int id, int timestamp, Datum datum, Uhrzeit uhrzeit, String text) {
this.id = id;
this.timestamp = timestamp;
this.datum = datum;
this.uhrzeit = uhrzeit;
this.text = text;
}
@Override
public String toString() {
String tag = String.valueOf(datum.getTag());
String monat = String.valueOf(datum.getMonat());
String jahr = String.valueOf(datum.getJahr());
String datum = tag + "." + monat + "." + jahr.substring(2, 4);
String stunden = String.valueOf(uhrzeit.getStunden());
String minuten = String.valueOf(uhrzeit.getMinuten());
String uhrzeit = stunden + ":" + ((minuten.length() == 1) ? "0" + minuten : minuten);
return datum + ", " + uhrzeit + ": " + text;
}
// private String firstLine(String text) {
// String line = "";
// int i = 0;
// while (i < text.length() - 1 && text.charAt(i) != '\n') {
// line += text.charAt(i++);
// }
// return line;
// }
public int getId() {
return id;
}
public int getTimestamp() {
return timestamp;
}
public void setTimestamp(int timestamp) {
this.timestamp = timestamp;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Datum getDatum() {
return datum;
}
public Uhrzeit getUhrzeit() {
return uhrzeit;
}
}