Module sc2002_fypms
Package models

Class Supervisor

  • Direct Known Subclasses:
    FYPCoordinator

    public class Supervisor
    extends User
    The Supervisor class represents a user with the role of supervisor. It is a subclass of the User 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 a Supervisor.
      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 a Supervisor object with given supervisor ID, name, email, password, and number of projects.
    • 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 a Supervisor.
        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 a Supervisor object with given supervisor ID, name, email, password, and number of projects.
        Parameters:
        supervisorID - the ID of the supervisor
        name - the name of the supervisor
        email - the email address of the supervisor
        password - the password of the supervisor
        numOfProjects - 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