-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibro.java
47 lines (34 loc) · 1002 Bytes
/
Libro.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
public class Libro extends Publicacion{
private Long isbn;
private Integer clasification;
public Libro(Long isbn, Integer clasifcation, Integer year, String titulo, Integer autor, Integer prestado) {
super(year, titulo, autor, prestado);
this.setClasification(clasifcation);
this.setISBN(isbn);
}
public Long getISBN() {
return isbn;
}
public String devolverCategoria() {
switch(this.getClasification()) {
case 000: return "Ciencias de la computacion, informacion y tratados generales";
case 500: return "Ciencias exactas";
case 600: return "Tecnologia";
case 900: return "Historia y geografia";
default: return "Categoria invalida";
}
}
public String devolverAntiguo() {
if(this.getYear() < 1994) return "Antiguo";
return "";
}
public void setISBN(Long isbn) {
this.isbn = isbn;
}
public Integer getClasification() {
return clasification;
}
public void setClasification(Integer clasification) {
this.clasification = clasification;
}
}