|
@ -1,43 +1,98 @@ |
|
|
package org.example; |
|
|
package org.example; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Represents a professor in the system. |
|
|
|
|
|
* This class holds the details of a professor including their ID, name, and role. |
|
|
|
|
|
*/ |
|
|
public class Professor { |
|
|
public class Professor { |
|
|
|
|
|
|
|
|
|
|
|
// Unique identifier for the professor |
|
|
private String professorID; |
|
|
private String professorID; |
|
|
|
|
|
|
|
|
|
|
|
// Name of the professor |
|
|
private String Name; |
|
|
private String Name; |
|
|
|
|
|
|
|
|
|
|
|
// Role of the professor in the system |
|
|
public String role; |
|
|
public String role; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Default constructor. |
|
|
|
|
|
*/ |
|
|
public Professor() { |
|
|
public Professor() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Constructs a new Professor with the specified ID, name, and role. |
|
|
|
|
|
* |
|
|
|
|
|
* @param professorID the unique identifier for the professor |
|
|
|
|
|
* @param name the name of the professor |
|
|
|
|
|
* @param role the role of the professor in the system |
|
|
|
|
|
*/ |
|
|
public Professor(String professorID, String name, String role) { |
|
|
public Professor(String professorID, String name, String role) { |
|
|
this.professorID = professorID; |
|
|
this.professorID = professorID; |
|
|
Name = name; |
|
|
|
|
|
|
|
|
this.Name = name; |
|
|
this.role = role; |
|
|
this.role = role; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Retrieves the professor's ID. |
|
|
|
|
|
* |
|
|
|
|
|
* @return the unique identifier for the professor |
|
|
|
|
|
*/ |
|
|
public String getProfessorID() { |
|
|
public String getProfessorID() { |
|
|
return professorID; |
|
|
return professorID; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Sets the professor's ID to the specified value. |
|
|
|
|
|
* |
|
|
|
|
|
* @param professorID the unique identifier for the professor |
|
|
|
|
|
*/ |
|
|
public void setProfessorID(String professorID) { |
|
|
public void setProfessorID(String professorID) { |
|
|
this.professorID = professorID; |
|
|
this.professorID = professorID; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Retrieves the professor's name. |
|
|
|
|
|
* |
|
|
|
|
|
* @return the name of the professor |
|
|
|
|
|
*/ |
|
|
public String getName() { |
|
|
public String getName() { |
|
|
return Name; |
|
|
return Name; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Sets the professor's name to the specified value. |
|
|
|
|
|
* |
|
|
|
|
|
* @param name the name of the professor |
|
|
|
|
|
*/ |
|
|
public void setName(String name) { |
|
|
public void setName(String name) { |
|
|
Name = name; |
|
|
|
|
|
|
|
|
this.Name = name; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Retrieves the role of the professor in the system. |
|
|
|
|
|
* |
|
|
|
|
|
* @return the role of the professor |
|
|
|
|
|
*/ |
|
|
public String getRole() { |
|
|
public String getRole() { |
|
|
return role; |
|
|
return role; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Sets the role of the professor in the system to the specified value. |
|
|
|
|
|
* |
|
|
|
|
|
* @param role the role of the professor |
|
|
|
|
|
*/ |
|
|
public void setRole(String role) { |
|
|
public void setRole(String role) { |
|
|
this.role = role; |
|
|
this.role = role; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Returns a string representation of the Professor object. |
|
|
|
|
|
* The string includes the professor's ID, name, and role. |
|
|
|
|
|
* |
|
|
|
|
|
* @return a string representation of the Professor object |
|
|
|
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public String toString() { |
|
|
public String toString() { |
|
|
return "Professor{" + |
|
|
return "Professor{" + |
|
|