-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pelicula.java
91 lines (72 loc) · 1.79 KB
/
Pelicula.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
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
public class Pelicula implements Entregable {
private String title;
private Integer year;
private Boolean gived;
private String genere;
private String director;
public Pelicula() {
this.setTitle("");
this.setYear(0000);
this.gived = Boolean.FALSE;
this.setGenere("");
this.setDirector("No definido");
}
public Pelicula(String title, Integer year, String genere, String director) {
this.setTitle(title);
this.setYear(year);
this.gived = Boolean.FALSE;
this.setGenere(genere);
this.setDirector(director);
}
public Pelicula(String title, String director) {
this.setTitle(title);
this.setYear(0000);
this.gived = Boolean.FALSE;
this.setGenere("");
this.setDirector(director);
}
public String getTitle() {
return title;
}
public void prestar() {
this.gived = Boolean.TRUE;
}
public void devolver() {
this.gived = Boolean.FALSE;
}
public Boolean isEntregado() {
return this.gived;
}
public Integer compareTo(Object a) {
Pelicula other = (Pelicula) a;
return this.getYear().compareTo(other.getYear());
}
public String toString() {
return "( Titulo: " + this.getTitle() + "\nAno: " + this.getYear() + "\nEntregado: " + this.conseguirEntregable() + "\nGenero: " + this.getGenere() + "\nDirector: " + this.getDirector() + ")";
}
public String conseguirEntregable(){
if(this.isEntregado()) return "Entregado.";
return "No entregado.";
}
public void setTitle(String title) {
this.title = title;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public String getGenere() {
return genere;
}
public void setGenere(String genere) {
this.genere = genere;
}
public String getDirector() {
return director;
}
public void setDirector(String director) {
this.director = director;
}
}