operation.java

来自「呵呵.着是我JAVA东软培训,老师给个一个小的项目.是CMD窗口实现的.就是控制」· Java 代码 · 共 74 行

JAVA
74
字号
//说明:实现接口。
public class Operation implements EditorOperation{
	int count;
	String param1;
	String param2;
	boolean control=false; 
	public Operation(){
		
	}
	public void getCommand(String s[]){
		
	}
		
	
	public int getParamcount(int i){
		this.count=i;
		return count;
	}
		
	
	public String execute(){
		return "";
	} 
	      
    public static void main(String argv[]) throws mainexception{
    	if(argv.length==0){           //judgement of exception   
    		throw new mainexception();
    	}else if(argv.length==1){
    		throw new mainexception(argv[0]);
    	}//end if;
    	 String get=argv[1];
	     if(get.equalsIgnoreCase("i")){
	     	InsertOperation o=new InsertOperation();
	     	o.getCommand(argv);
	     	System.out.println(o.execute());
	     }else if(get.equalsIgnoreCase("tl")){
	     	LowerOperation tl=new LowerOperation();
	     	tl.getCommand(argv);
	     	System.out.println(tl.execute());
	     }else if(get.equalsIgnoreCase("rev")){
	     	ReverseOperation rev=new ReverseOperation();
	     	rev.getCommand(argv);
	     	System.out.println(rev.execute());
	     }else if(get.equalsIgnoreCase("r")){
	     	RemoveOperation r=new RemoveOperation();
	     	r.getCommand(argv);
	     	System.out.println(r.execute());
	     }else if(get.equalsIgnoreCase("sub")){
	     	SubOperation sub=new SubOperation();
	     	sub.getCommand(argv);
	     	System.out.println(sub.execute());
	     	
	     }else if(get.equalsIgnoreCase("tu")){
	     	UpperOperation tu=new UpperOperation();
	     	tu.getCommand(argv);
	     	System.out.println(tu.execute());
	     	
	     }else if(get.equalsIgnoreCase("s")){
	     	SubstOperation s=new SubstOperation();
	     	s.getCommand(argv);
	     	System.out.println(s.execute());
	     }else{
	     	System.out.println("请插入有效的操作命令!");
	     }
	     
		  
			
			
		
	
		
		
	}//end main();
}

⌨️ 快捷键说明

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