instructor.java

来自「国外的数据结构与算法分析用书」· Java 代码 · 共 45 行

JAVA
45
字号
package Entities;

import Sets.DepartmentSet;
import dslib.list.LinkedListUos;

/**	Defines an instructor at the university. */
public class Instructor extends Staff
{
	
	/**	Create a new instructor with a name and password */
	public Instructor(String n, String pwd, int deptNum)
	{
		name = n;
		password = pwd;
		department = DepartmentSet.getDepartment(deptNum);
		department.addInstructor(this);
		classes = new LinkedListUos();
	}
	
	/**	The  classes the instructor is teaching */
	protected LinkedListUos classes;

	/**	The department the instructor belongs */
	protected Department department;

	/**	Return the department */
	public Department department()
	{
		return department;
	}
	
	/**	Add a section to the list of courses this instructor teaches */
	public void addCourse(CourseSection courseSec)
	{
		classes.insert(courseSec);
	}
	
	/**	Return a string representation of the instructor */
	public String toString()
	{
		return  name ;
	}

} /* end of Instructor */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?