📄 mshowallcommand.java
字号:
package cmd;import core.*;import db.*;import java.util.List;public class MShowAllCommand extends MDatabaseCommand{ private static final String [] PARAM_NAMES = { }; private static final String [] PARAM_PROMPTS = { }; public MShowAllCommand () throws java.io.IOException { super (); } public String [] getParameterNames () { return PARAM_NAMES; } public String [] getParameterPrompts () { return PARAM_PROMPTS; } public boolean isInitialized () { return true; } protected void executeDatabaseCommand (HotelDB database) { List reservations = database.getReservations(); displayResults ("All Reservations", reservations); } protected void displayResultsText (String title, List reservations) { System.out.println (title); if (reservations.size() > 0) DBUtilities.displayReservations (reservations); else System.out.println ("No reservations in database."); } public String getMenuName () { return "Show All"; } public String getName () { return "all"; } public String getDescription () { return "Shows all the reservations"; } public Command makeInstance () { try { return new MShowAllCommand (); } catch (java.io.IOException e) { return null; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -