📄 customersetaccess.java
字号:
package Sets;
import People.Customer;
import dslib.dictionary.PKeyedBasicDictUos;
import dslib.dictionary.arrayed.ArrayedPKeyedBasicDictUos;
/** Provides access to the dictionary containing the customers. */
public class CustomerSetAccess
{
/** The dictionary for customers. */
private static PKeyedBasicDictUos dictionary;
/** Returns the dictionary that maps names to customers.
Analysis: Time = O(1) */
public static PKeyedBasicDictUos dictionary()
{
return dictionary;
}
/** Display all the information of customer
Analysis: Time = O(1) */
public static void displayCustomer()
{
System.out.println("The customer's name is: Elvis Presley");
System.out.println("The customer's name is: Wile E. Coyote\n");
}
/** Initializes the customer dictionary.
Analysis: Time = O(1) */
static
{
dictionary = new ArrayedPKeyedBasicDictUos(10);
dictionary.insert("Elvis Presley", new Customer("Elvis Presley"));
dictionary.insert("Wile E. Coyote", new Customer("Wile E. Coyote"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -