login.java

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

JAVA
37
字号
import Commands.LoginCheck;
import Commands.InterfaceBuilder;
import Interfaces.*;
import Sets.*;

/**	Initiate interactions with a sequence of logins. */
public class Login
{
	/**	Input a sequence of login requests.  For each one, call a method to verify the person
		logging in has authorization, obtain an appropriate interface for the person, and then
		create and initiate a controller to handle the interaction with this person. */
	public static void main(String[ ] args)
	{
		System.out.println("The bank system contains several preloaded data. It consists");
		System.out.println("teller, administrator, customers and their account information.\n");
		System.out.println("Data for the tellers and administrator:");
		StaffSetAccess.displayStaff();
		System.out.println("Data for the customers:");
		CustomerSetAccess.displayCustomer();
		System.out.println("Data for the accounts:");
		AccountSetAccess.displayAccount();
		Interface loginInterface = new Interface(); // obtain a generic interface for logging in
		int id = loginInterface.getLoginID(); // obtain the id of the user
		while (id != 0)
		{
			if (LoginCheck.valid(id, loginInterface))
			{
				StaffInterface userInterface = InterfaceBuilder.get(id);
				Controller controller = new Controller();
				controller.initiate(userInterface);
			}

			id = loginInterface.getLoginID(); // obtain the id of the next user
		}
	}
} 

⌨️ 快捷键说明

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