This repository was archived by the owner on May 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrarian.java
More file actions
54 lines (47 loc) · 1.77 KB
/
Librarian.java
File metadata and controls
54 lines (47 loc) · 1.77 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
/**
* @author Dale Butt, 957450
*
* This file is the subclass of Controller and contains all
* Librarian information, it gives administrative access to
* the Tawe-Library for all these types of users.
*
*/
public class Librarian extends Controller {
// what happens if we hit max value? (need to change int to long or something bigger/better)
private static int uniqueStaffID = 1000; // used to generate a staffNumber (4 numbers)
String employmentStart;// = new Date();
int staffNumber;
// Constructor to create a brand new librarian
public Librarian(String userID, String forename, String surname, String phone, String tele, String location, String imageURL, String employmentDate) {
super(userID, forename, surname, phone, tele, location, imageURL);
employmentStart = employmentDate;
staffNumber = ++uniqueStaffID;
}
// Constructor to create a librarian with known information (preloads)
public Librarian(int staffID, String userID, String forename, String surname, String phone, String tele, String location, String imageURL, String employmentDate) {
super(userID, forename, surname, phone, tele, location, imageURL);
employmentStart = employmentDate;
staffNumber = staffID;
}
/**
* @return the employmentStart
*/
public String getEmploymentStart() {
return employmentStart;
}
/**
* @return the staffNumber
*/
public int getStaffNumber() {
return staffNumber;
}
/**
* @return A string of personal information
*/
@Override
public String translateToText() {
return "Librarian, " + this.getUsername() + ", " + this.getFirstName() + ", "+ this.getLastName() +
", " + this.getPhoneNumber() + ", " + this.getTelephone() + ", " + this.getAddress() +
", " + this.getProfilePicture().getPictureURL() + ", " + this.getEmploymentStart();
}
}