- java.lang.Object
-
- models.Project
-
public class Project extends java.lang.ObjectTheProjectclass represents a project that a supervisor has created
-
-
Field Summary
Fields Modifier and Type Field Description private static intlastProjectIDThe ID of the last project that was created.private intprojectIDThe ID of the project.private ProjectStatusstatusThe status of the project.private java.lang.StringstudentIDThe ID of the student who is working on this project.private java.lang.StringsupervisorIDThe ID of the supervisor assigned to supervise this project.private java.lang.StringtitleThe title of the project.
-
Constructor Summary
Constructors Constructor Description Project(int projectID, java.lang.String title, java.lang.String supervisorID, java.lang.String studentID, ProjectStatus status)Constructs aProjectobject for an existing projectProject(java.lang.String title, java.lang.String supervisorID, java.lang.String studentID, ProjectStatus status)Constructs aProjectobject for a new project
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetProjectID()Returns the ID of the project.ProjectStatusgetStatus()Returns the status of the project.StudentgetStudent()Returns the student assigned to the project.SupervisorgetSupervisor()Returns the supervisor assigned to supervise the project.java.lang.StringgetTitle()Returns the title of the project.booleansetStatus(ProjectStatus status)Sets the status of the project.booleansetStudent(java.lang.String studentID)Sets the student assigned to the project.booleansetSupervisor(java.lang.String supervisorID)Sets the supervisor assigned to supervise the project.booleansetTitle(java.lang.String title)Sets the title of the project.
-
-
-
Field Detail
-
lastProjectID
private static int lastProjectID
The ID of the last project that was created.
-
projectID
private int projectID
The ID of the project.
-
title
private java.lang.String title
The title of the project.
-
studentID
private java.lang.String studentID
The ID of the student who is working on this project.
-
supervisorID
private java.lang.String supervisorID
The ID of the supervisor assigned to supervise this project.
-
status
private ProjectStatus status
The status of the project.
-
-
Constructor Detail
-
Project
public Project(int projectID, java.lang.String title, java.lang.String supervisorID, java.lang.String studentID, ProjectStatus status)Constructs aProjectobject for an existing project- Parameters:
projectID- the ID of the project to initializetitle- the title of the projectsupervisorID- the ID of the supervisor assigned to the projectstudentID- the ID of the student working on the projectstatus- the status of the project
-
Project
public Project(java.lang.String title, java.lang.String supervisorID, java.lang.String studentID, ProjectStatus status)Constructs aProjectobject for a new project- Parameters:
title- the title of the projectsupervisorID- the ID of the supervisor assigned to the projectstudentID- the ID of the student working on the projectstatus- the status of the project
-
-
Method Detail
-
getProjectID
public int getProjectID()
Returns the ID of the project.- Returns:
- the project ID
-
getTitle
public java.lang.String getTitle()
Returns the title of the project.- Returns:
- the project title
-
setTitle
public boolean setTitle(java.lang.String title)
Sets the title of the project.- Parameters:
title- the project title to set- Returns:
- true if the title is set successfully
-
getStatus
public ProjectStatus getStatus()
Returns the status of the project.- Returns:
- the project status
-
setStatus
public boolean setStatus(ProjectStatus status)
Sets the status of the project.- Parameters:
status- theProjectStatusto set- Returns:
- true if the status is set successfully
-
getSupervisor
public Supervisor getSupervisor()
Returns the supervisor assigned to supervise the project.- Returns:
- the supervisor assigned to the project, or null if the supervisor is not found
-
setSupervisor
public boolean setSupervisor(java.lang.String supervisorID)
Sets the supervisor assigned to supervise the project.- Parameters:
supervisorID- the supervisor ID to set- Returns:
- true if the supervisor is set successfully
-
getStudent
public Student getStudent()
Returns the student assigned to the project.- Returns:
- the student assigned to the project
-
setStudent
public boolean setStudent(java.lang.String studentID)
Sets the student assigned to the project.- Parameters:
studentID- the ID of the student to set- Returns:
- true if the student is set successfully
-
-