forked from daveagp/java_visualize
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBulletin.java
More file actions
48 lines (48 loc) · 1.07 KB
/
Bulletin.java
File metadata and controls
48 lines (48 loc) · 1.07 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
package studsabstract;
public class Bulletin{
private boolean value;
private Personne votant;
private Scrutin scrutin;
private Choix choix;
public Bulletin(final Personne p, final Scrutin s,
final Choix c, final boolean v) {
votant = p;
scrutin = s;
value = v;
choix = c;
choix.addBulletin(this);
}
public boolean getValue() {
return value;
}
public void setValue(final boolean val) {
value = val;
}
public void retirerDuChoix() {
choix.retirerBulletin(this);
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (!(obj instanceof Bulletin))
return false;
Bulletin other = (Bulletin) obj;
if (choix == null) {
if (other.choix != null)
return false;
} else if (!choix.equals(other.choix))
return false;
if (scrutin == null) {
if (other.scrutin != null)
return false;
} else if (!scrutin.equals(other.scrutin))
return false;
if (votant == null) {
if (other.votant != null)
return false;
} else if (!votant.equals(other.votant))
return false;
return true;
}
}