📄 staffsetaccess.java
字号:
package Sets;
import People.*;
import dslib.dictionary.PKeyedBasicDictUos;
import dslib.dictionary.arrayed.ArrayedPKeyedBasicDictUos;
/** Provides access to the dictionary containing staff members. */
public class StaffSetAccess
{
/** The dictionary for staff. */
private static PKeyedBasicDictUos dictionary;
/** Returns the dictionary that maps staff ID's to staff members.
Analysis: Time = O(1) */
public static PKeyedBasicDictUos dictionary()
{
return dictionary;
}
/** Display all the staff information
Analysis: Time = O(1) */
public static void displayStaff()
{
System.out.println("The login ID for teller is: 100");
System.out.println("The password for teller is: 100");
System.out.println("The teller's name is: George Bailey\n");
System.out.println("The login ID for administrator is: 1");
System.out.println("The password for administrator is: 1");
System.out.println("The administrator' name is: Mr. Drysdale\n");
}
/** Initializes the staff dictionary.
Analysis: Time = O(1) */
static
{
dictionary = new ArrayedPKeyedBasicDictUos(5);
dictionary.insert(new Integer(1), new Admin("Mr. Drysdale", 1, "1"));
dictionary.insert(new Integer(100), new Teller("George Bailey", 100, "100"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -