- java.lang.Object
-
- models.User
-
- models.Supervisor
-
- Direct Known Subclasses:
FYPCoordinator
public class Supervisor extends User
TheSupervisor
class represents a user with the role of supervisor. It is a subclass of theUser
class and includes additional properties specific to a supervisor, such as a supervisor ID and the number of projects supervised.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_PROJECTS
The maximum number of projects that can be supervised by aSupervisor
.private int
numOfProjects
The number of projects supervised by the supervisor.private java.lang.String
supervisorID
The ID of the supervisor.
-
Constructor Summary
Constructors Constructor Description Supervisor(java.lang.String supervisorID, java.lang.String name, java.lang.String email, java.lang.String password, int numOfProjects)
Constructs aSupervisor
object with given supervisor ID, name, email, password, and number of projects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNumOfProjects()
Returns the number of projects supervised by the Supervisor.java.lang.String
getSupervisorID()
Returns the supervisor ID of the Supervisor.java.lang.Boolean
setNumOfProjects(int numOfProjects)
Sets the number of projects supervised by the Supervisor.-
Methods inherited from class models.User
getEmail, getName, getPassword, getRole, getUserID, setPassword, setRole
-
-
-
-
Field Detail
-
supervisorID
private java.lang.String supervisorID
The ID of the supervisor.
-
numOfProjects
private int numOfProjects
The number of projects supervised by the supervisor.
-
MAX_PROJECTS
public static final int MAX_PROJECTS
The maximum number of projects that can be supervised by aSupervisor
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Supervisor
public Supervisor(java.lang.String supervisorID, java.lang.String name, java.lang.String email, java.lang.String password, int numOfProjects)
Constructs aSupervisor
object with given supervisor ID, name, email, password, and number of projects.- Parameters:
supervisorID
- the ID of the supervisorname
- the name of the supervisoremail
- the email address of the supervisorpassword
- the password of the supervisornumOfProjects
- the number of projects supervised by the supervisor
-
-
Method Detail
-
getSupervisorID
public java.lang.String getSupervisorID()
Returns the supervisor ID of the Supervisor.- Returns:
- the supervisor ID
-
getNumOfProjects
public int getNumOfProjects()
Returns the number of projects supervised by the Supervisor.- Returns:
- the number of projects supervised
-
setNumOfProjects
public java.lang.Boolean setNumOfProjects(int numOfProjects)
Sets the number of projects supervised by the Supervisor.- Parameters:
numOfProjects
- the number of projects to set- Returns:
- true if number of projects is set successfully, false if the number
of projects exceeds the maximum number
(
MAX_PROJECTS
) of projects allowed
-
-