Module sc2002_fypms
Package models

Class Project


  • public class Project
    extends java.lang.Object
    The Project class represents a project that a supervisor has created
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int lastProjectID
      The ID of the last project that was created.
      private int projectID
      The ID of the project.
      private ProjectStatus status
      The status of the project.
      private java.lang.String studentID
      The ID of the student who is working on this project.
      private java.lang.String supervisorID
      The ID of the supervisor assigned to supervise this project.
      private java.lang.String title
      The 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 a Project object for an existing project
      Project​(java.lang.String title, java.lang.String supervisorID, java.lang.String studentID, ProjectStatus status)
      Constructs a Project object for a new project
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getProjectID()
      Returns the ID of the project.
      ProjectStatus getStatus()
      Returns the status of the project.
      Student getStudent()
      Returns the student assigned to the project.
      Supervisor getSupervisor()
      Returns the supervisor assigned to supervise the project.
      java.lang.String getTitle()
      Returns the title of the project.
      boolean setStatus​(ProjectStatus status)
      Sets the status of the project.
      boolean setStudent​(java.lang.String studentID)
      Sets the student assigned to the project.
      boolean setSupervisor​(java.lang.String supervisorID)
      Sets the supervisor assigned to supervise the project.
      boolean setTitle​(java.lang.String title)
      Sets the title of the project.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 a Project object for an existing project
        Parameters:
        projectID - the ID of the project to initialize
        title - the title of the project
        supervisorID - the ID of the supervisor assigned to the project
        studentID - the ID of the student working on the project
        status - the status of the project
      • Project

        public Project​(java.lang.String title,
                       java.lang.String supervisorID,
                       java.lang.String studentID,
                       ProjectStatus status)
        Constructs a Project object for a new project
        Parameters:
        title - the title of the project
        supervisorID - the ID of the supervisor assigned to the project
        studentID - the ID of the student working on the project
        status - 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 - the ProjectStatus to 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