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

📄 monthendcommand.java

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

import Interfaces.*;
import Sets.AccountSetAccess;
import SystemEntities.Printer;
import Accounts.Account;

/**	The command to print out all month end statements */
public class MonthEndCommand extends Command
{
	/**	The interface that is to be used by this command */
	AdminInterface cmdInterface;
	
	/**	The constructor for this command */
	public MonthEndCommand(StaffInterface userInterface)
	{
		if (userInterface instanceof AdminInterface)	
			cmdInterface = (AdminInterface) userInterface;
		else
			userInterface.sendMessage("You are not allowed to print the month end statement.");
	}

	/**	Execute the command */
	public void execute()
	{
		if (cmdInterface != null)
		{
			AccountSetAccess.dictionary().goFirst();
			while (!AccountSetAccess.dictionary().after())
			{
				Printer.printStmt(((Account)AccountSetAccess.dictionary().item()).generateMonthlyStmt());
				AccountSetAccess.dictionary().goForth();
			}
		}
	}
}

⌨️ 快捷键说明

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