-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvento.java
More file actions
96 lines (79 loc) · 1.7 KB
/
Copy pathEvento.java
File metadata and controls
96 lines (79 loc) · 1.7 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
public class Evento {
private String nome;
private String autor;
private int preco;
private int[] data = new int[3];
private String local;
public Evento(String nome, String autor, int preco, int[] data, String local) {
super();
this.nome = nome;
this.autor = autor;
this.preco = preco;
this.data[0] = data[0];
this.data[1] = data[1];
this.data[2] = data[2];
this.local = local;
}
public void Excluir() {
this.nome = null;
this.autor = null;
this.preco = 0;
this.data[0] = 00;
this.data[1] = 00;
this.data[2] = 0000;
this.local = null;
}
public boolean equals(Evento evento) {
if (this.nome.equals(evento.nome)) {
if (this.autor.equals(evento.autor)) {
if (this.preco == evento.preco) {
if (evento.equals(this.data)) {
if (this.local.equals(evento.local)) {
return true;
}
}
}
}
}
return false;
}
public boolean equals(int[] data) {
boolean igualdade = true;
for (int i = 0; i < this.data.length; i++) {
if (this.data[i] != data[i]) {
igualdade = false;
}
}
return igualdade;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getAutor() {
return autor;
}
public void setAutor(String autor) {
this.autor = autor;
}
public int getPreço() {
return preco;
}
public void setPreço(int preço) {
this.preco = preço;
}
public int[] getData() {
return data;
}
public void setData(int[] data) {
this.data = data;
}
public String getLocal() {
return local;
}
public void setLocal(String local) {
this.local = local;
}
}