1700481479
//根据分隔符号拆分出执行符号
1700481480
1700481481
String[]complexStr=commandStr.split(CommandVO.DIVIDE_FLAG);
1700481482
1700481483
//第一个参数是执行符号
1700481484
1700481485
this.commandName=complexStr[0];
1700481486
1700481487
//把参数放到List中
1700481488
1700481489
for(int i=1;i<complexStr.length;i++){
1700481490
1700481491
String str=complexStr[i];
1700481492
1700481493
//包含前缀符号,认为是参数
1700481494
1700481495
if(str.indexOf(CommandVO.PREFIX)==0){
1700481496
1700481497
this.paramList.add(str.replace(CommandVO.PREFIX,””).trim());
1700481498
1700481499
}else{
1700481500
1700481501
this.dataList.add(str.trim());
1700481502
1700481503
}
1700481504
1700481505
}
1700481506
1700481507
}else{
1700481508
1700481509
//传递的命令错误
1700481510
1700481511
System.out.println(“命令解析失败,必须传递一个命令才能执行!”);
1700481512
1700481513
}
1700481514
1700481515
}
1700481516
1700481517
//得到命令名
1700481518
1700481519
public String getCommandName(){
1700481520
1700481521
return this.commandName;
1700481522
1700481523
}
1700481524
1700481525
//获得参数
1700481526
1700481527
public ArrayList<String>getParam(){
1700481528
[
上一页 ]
[ :1.700481479e+09 ]
[
下一页 ]