OSDN Git Service

modified: build/classes/parauni/CommandController.class
[parauni/para-repos.git] / src / parauni / CommandController.java
1 package parauni;
2
3 import java.io.IOException;
4 import java.sql.SQLException;
5
6 /**
7  *
8  * @author karihei
9  */
10 public class CommandController {
11     // String com;
12     public CommandController(){
13         // 保留
14     }
15
16     public boolean CommandSelector(String com) throws IOException, SQLException, ClassNotFoundException{
17         UserTaskModel utaskmodel = new UserTaskModel();
18         UserTaskView utaskview = new UserTaskView();
19         String comlist[] = com.split(" ");
20         String head = comlist[0];
21         String arg[] = new String[comlist.length-1];
22
23         // 残りの引数をargに格納
24         for (int i = 0;i < comlist.length-1; i++) {
25             arg[i] = comlist[i+1];
26         }
27
28         if(head.equals("mktask")){
29             utaskmodel.makeTask(arg);
30         } else if(head.equals("rmtask")){
31
32         } else if(head.equals("lstask")){
33             utaskview.showTaskList();
34         } else if(head.equals("vmrun")){
35
36         } else if(head.equals("exit")){
37             return false;
38         } else {
39             System.out.println("command not found.");
40         }
41
42         return true;
43     }
44
45
46 }