agendaservice.java
来自「采用面向对象方法和Java语言开发一个基于命令行交互方式的议程(agenda)管」· Java 代码 · 共 61 行
JAVA
61 行
import java.io.*;
import agenda.*;
/**
*@author haha
*/
/**
* 程序执行用户界面
*/
public class AgendaService
{
public AgendaService()
{
System.out.println("若注册用户请输入:register userName password");
System.out.println("若添加请输入:add userName password other startTime endTime title");
System.out.println("若查询请输入:query userName password startTime endTime");
System.out.println("若删除请输入:delete userName password meetingId");
System.out.println("若清除请输入:clear userName password");
System.out.println("时间格式输入方式为:00:00");
}
public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException
{
AgendaService agenda = new AgendaService();
Agenda ag = new Agenda();
String [] command =null;
System.out.print("$");
try
{
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
String str = buf.readLine();
command = str.split("[ \t]+");
//System.out.println(command[0]);
} catch (Exception exc) {
System.out.println("Wrong command");
}
while(!command[0].equals("quit"))
{
Command cmd = CommandFactory.getCommand(command[0].toString().toLowerCase());
ag = cmd.excute(ag,command);
System.out.print("$");
try
{
BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
String str = buf.readLine();
command = str.split("[ \t]+");
} catch (Exception exc) {
System.out.println("Wrong command");
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?