📄 monthendcommand.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 + -