1 |
package dk.daoas.adressevedligehold;
|
2 |
|
3 |
|
4 |
|
5 |
public class EntryUgedage {
|
6 |
public boolean mandag = false;
|
7 |
public boolean tirsdag = false;
|
8 |
public boolean onsdag = false;
|
9 |
public boolean torsdag = false;
|
10 |
public boolean fredag = false;
|
11 |
public boolean lordag = false;
|
12 |
public boolean sondag = false;
|
13 |
|
14 |
|
15 |
public static final EntryUgedage MAN_TOR;
|
16 |
public static final EntryUgedage MAN_FRE;
|
17 |
|
18 |
public static final EntryUgedage MAN;
|
19 |
public static final EntryUgedage TIR;
|
20 |
public static final EntryUgedage ONS;
|
21 |
public static final EntryUgedage TOR;
|
22 |
public static final EntryUgedage FRE;
|
23 |
public static final EntryUgedage LOR;
|
24 |
public static final EntryUgedage SON;
|
25 |
|
26 |
public void merge(EntryUgedage otherEntry) {
|
27 |
if (otherEntry.mandag)
|
28 |
mandag = true;
|
29 |
if (otherEntry.tirsdag)
|
30 |
tirsdag = true;
|
31 |
if (otherEntry.onsdag)
|
32 |
onsdag = true;
|
33 |
if (otherEntry.torsdag)
|
34 |
torsdag = true;
|
35 |
if (otherEntry.fredag)
|
36 |
fredag = true;
|
37 |
if (otherEntry.lordag)
|
38 |
lordag = true;
|
39 |
if (otherEntry.sondag)
|
40 |
sondag = true;
|
41 |
}
|
42 |
|
43 |
@Override
|
44 |
public String toString() {
|
45 |
return String.format("EntryUgedage{ma=%b ti=%b on=%b to=%b fr=%b lo=%b so=%b}", mandag,tirsdag,onsdag,torsdag,fredag,lordag,sondag);
|
46 |
}
|
47 |
|
48 |
|
49 |
static {
|
50 |
MAN_TOR = new EntryUgedage();
|
51 |
MAN_TOR.mandag = true;
|
52 |
MAN_TOR.tirsdag = true;
|
53 |
MAN_TOR.onsdag = true;
|
54 |
MAN_TOR.torsdag = true;
|
55 |
|
56 |
MAN_FRE = new EntryUgedage();
|
57 |
MAN_FRE.mandag = true;
|
58 |
MAN_FRE.tirsdag = true;
|
59 |
MAN_FRE.onsdag = true;
|
60 |
MAN_FRE.torsdag = true;
|
61 |
MAN_FRE.fredag = true;
|
62 |
|
63 |
MAN = new EntryUgedage();
|
64 |
MAN.mandag = true;
|
65 |
|
66 |
TIR = new EntryUgedage();
|
67 |
TIR.tirsdag = true;
|
68 |
|
69 |
ONS = new EntryUgedage();
|
70 |
ONS.onsdag = true;
|
71 |
|
72 |
TOR = new EntryUgedage();
|
73 |
TOR.torsdag = true;
|
74 |
|
75 |
FRE = new EntryUgedage();
|
76 |
FRE.fredag = true;
|
77 |
|
78 |
LOR = new EntryUgedage();
|
79 |
LOR.lordag = true;
|
80 |
|
81 |
SON = new EntryUgedage();
|
82 |
SON.sondag = true;
|
83 |
|
84 |
}
|
85 |
|
86 |
}
|
87 |
|
88 |
|
89 |
|