⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 operator.java

📁 This book code procedure according to the chapter arrangement, the 1st chapter of example under "1"
💻 JAVA
字号:
package com.example.operate;
import java.util.*;
/**
 * <p>标题: 操作者</p>
 * <p>描述: 将命令类封装在Hashtable中,通过命令字符来重新获取相应的类。</p>
 * <p>版权: Copyright (c) 2005</p>
 * <p>公司: </p>
 * @作者 杜江
 * @版本 1.0
 */
public class Operator{
   Hashtable queue = new Hashtable();
   public Operator(){
     queue.put("ctrl-new",new NewFile());
     queue.put("ctrl-open",new OpenFile());
     queue.put("ctrl-save",new SaveFile());
   }
   /**
   * 处理命令方法
   * @param pCom String 菜单或者工具触发的命令字符
   */
  public void dealWith(String pCom){
    Command c = (Command)queue.get(pCom);
    c.execute();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -