-
Notifications
You must be signed in to change notification settings - Fork 0
/
Title.java
109 lines (92 loc) · 2.66 KB
/
Title.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package teoskanta.title;
import teoskanta.user.User;
import teoskanta.user.dao.DBUserDao;
public class Title implements Comparable<Title> {
private int id;
private int userid;
private String year;
private String name;
private String genre;
private String author;
public String category;
private DBUserDao userdao;
/**
* Constructor for Title class.
*
* @param name String-type variable for name input
* @param author String-type variable for author input
* @param year String-type variable for year input
* @param userid int-type variable for userid input
* @param category String-type variable for category input
*/
public Title(String name, String author, String year, String category, int userid) {
this.name = name;
this.userid = userid;
this.author = author;
this.year = year;
this.category = category;
}
/**
* Constructor for Title class.
*
* @param id int-type variable for title id number input
* @param name String-type variable for name input
* @param author String-type variable for author input
* @param year String-type variable for year input
* @param userid int-type variable for userid input
* @param category String-type variable for category input
*/
public Title(int id, String name, String author, String year, String category, int userid) {
this.id = id;
this.name = name;
this.userid = userid;
this.author = author;
this.year = year;
this.category = category;
}
/**
* Constructor for Title class.
*
* @param name String-type variable for name input
* @param author String-type variable for author input
* @param user User-type variable for user object input
*/
public Title(String name, String author, User user) {
this.name = name;
this.author = author;
this.userid = user.getId();
}
/**
* Empty constructor for Title class.
*/
public Title() {
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return this.id;
}
public String getName() {
return this.name;
}
public String getAuthor() {
return this.author;
}
public String getYear() {
return this.year;
}
public String getGenre() {
return this.genre;
}
public int getUserId() {
return this.userid;
}
public String getCategory() {
return this.category;
}
@Override
public int compareTo(Title title) {
return this.name.compareTo(title.getAuthor());
}
}