mshowallcommand.java

来自「基于Java的软件信息系统-项目管理」· Java 代码 · 共 66 行

JAVA
66
字号
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 + =
减小字号Ctrl + -
显示快捷键?