package TomorrowTech;
import java.util.*;
/**
*
* @author oliver
*
* 功能集成框架,初级版
* 1、先写终端代码,集成功能(主流web配置生成, 爬虫, 主要UI界面生成, 翻译功能等综合体)
* 2、swing界面(阅读器等)
* 3、扩展接口
* 4、项目时间,有空时写写;
*
*/
public class $5_final_demo_1 {
// 大小写转换
private void exchangeLowAndUp(String command, String exchangeFlag) {
Scanner input = new Scanner(System.in);
System.out.print("请输入你的字符串: ");
String stringcase = input.next();
String exchangeResult = command.equalsIgnoreCase("lowcase") ? stringcase.toLowerCase() : stringcase.toUpperCase();
System.out.println("您要转换的字符串结果: " + exchangeResult);
}
// 运用的功能
private void operation(String command) {
// 命令处理中枢函数
switch (command) {
case "lowcase":
this.exchangeLowAndUp(command, "lowcase");
break;
case "upcase":
this.exchangeLowAndUp(command, "upcase");
break;
}
}
public static void main(String[] args) {
$5_final_demo_1 demo = new $5_final_demo_1();
Scanner input = new Scanner(System.in);
Boolean bool = true;
while (bool) {
System.out.print("请输入你的操作: ");
String getInput = input.next();
if (getInput.equalsIgnoreCase("quit")) {
bool = false;
System.out.println("操作结束!按命令已退出!");
}
demo.operation(getInput);
input = new Scanner(System.in);
}
}
}