📄 configoperationstring.java
字号:
package com.deskManager.File;import com.deskApp.Interface.FileOperation;import java.io.*;import java.util.ArrayList;public class ConfigOperationString implements FileOperation { public static String ConfigFileName = "data/proData/config.config"; public Config getConfig() throws Exception { FileReader fr = new FileReader(ConfigFileName); BufferedReader br = new BufferedReader(fr); String temp = br.readLine(); br.close(); fr.close(); char t[] = new char[1]; int count = 0; String tempstr[] = new String[2]; String tt = ""; for (int i = 0; i < temp.length(); i++) { t[0] = temp.charAt(i); if (t[0] == '|') { tempstr[count] = tt; count++; tt = ""; } else { tt = tt + new String(t); } } Config config = new Config(); config.setDoublechick(Integer.parseInt(tempstr[0])); config.setHistory(tempstr[1]); return config; } @Override public void SaveOrUpdate(Object config) throws Exception { FileWriter fw = new FileWriter(ConfigFileName); BufferedWriter bw = new BufferedWriter(fw); bw.write(config.toString()); bw.close(); fw.close(); } public int getDoubleChick() throws Exception { Config config = getConfig(); return config.getDoublechick(); } public String getHistory() throws Exception { Config config = getConfig(); return config.getHistory(); } @SuppressWarnings("unchecked") @Override public ArrayList list() throws Exception { throw new UnsupportedOperationException("Not supported yet."); } @Override public void del(Object o) throws Exception { throw new UnsupportedOperationException("Not supported yet."); } protected void taxis() throws Exception { throw new UnsupportedOperationException("Not supported yet."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -