⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 staffset.java

📁 国外的数据结构与算法分析用书
💻 JAVA
字号:
package Sets;

import Entities.*;
import dslib.dictionary.arrayed.ArrayedPKeyedDictUos;

/**	This class provides access to a dictionary of
	staff members that is keyed by name.  Staff members include
	registrars, instructors and administrators. */
public class StaffSet
{
	/**	Provides access to the dictionary of departments. */
	public static ArrayedPKeyedDictUos rep;
	
	public static void displayNames()
	{
		System.out.println("Professors");
		System.out.println("Albert Einstien, password: e=mc^2, department: 345");
		System.out.println("Mark Keil, password: 3sat, department: 865");
		System.out.println("Eric Neufeld, password: AI, department: 865\n");
		System.out.println("Registrar");
		System.out.println("Fred Smith, password: regis\n");
		System.out.println("Administrator");
		System.out.println("Joe Blow, password: admin\n");
	}
	
	static //execute only once (never explicitly called though)
	{	
		rep = new ArrayedPKeyedDictUos(10);

		Instructor prof = new Instructor("Albert Einstien", "e = mc^2",345);
		rep.insert(prof.name(), prof);
		
		prof = new Instructor("Mark Keil", "3sat",865);
		rep.insert(prof.name(), prof);    

		prof = new Instructor("Eric Neufeld", "AI",865);
		rep.insert(prof.name(), prof);

		Registrar regis = new Registrar("Fred Smith", "regis");
		rep.insert(regis.name(), regis);

		Administrator admin = new Administrator("Joe Blow", "admin");
		rep.insert(admin.name(), admin);
	}
	
} /* end of StaffSet */

⌨️ 快捷键说明

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