public void myDodel(String section,String variable) throws Exception{
int[] j = this.mySearch(section, variable);
if (j[0] != -1) {
if(!variable.equals("")){
if (j[1] != -1) {
this.inList.remove(j[1]);//删除一个节点
}
}else{
int num=this.myGetNum(section);
this.inList.remove(j[0]);
for(int i=0;i this.inList.remove(j[0]); } } } } public String myGetOne(String section, String variable, String temp) { int[] j = this.mySearch(section, variable); if (j[0] != -1) { if (j[1] != -1) { if ((temp = this.outList.get(j[1]).toString().split("=")[1]) != "") { return temp; } } } return temp; } public String myGetOne(String section, String variable) { // 2 parameters; return this.myGetOne(section, variable, "?"); } // end myGetOne(); public void mySetOne(String section, String variable, String value){ try{ int[] j = this.mySearch(section, variable); if (j[0] != -1) { if (j[1] != -1) { this.inList.set(j[1], variable + "=" + value); } else { this.inList.add(j[0] + 1, variable + "=" + value); } } else { this.inList.add(this.inList.size(),"[" + section + "]" + "\r\n" + variable + "=" + value); } }catch(Exception e){ System.out.print(e); } } // end mySetOne(); /* * 上边是对单行操作, 下边成批处理; @author Hongs(xhacker008) * * @version 2005.12.3 */ // myAdd(); private void myAdd(String[] args) { // args = {section, variable [, value]}; this.tagList.add(args); } public void myAdd(String section, String variable, String value) { String[] temp = { section, variable, value }; this.myAdd(temp); } public void myAdd(String section, String variable) { String[] temp = { section, variable, "?" }; this.myAdd(temp); } public void myAdd(String section, String[][] arr) { // arr[i] = {variable, // [, value]}; int i = 0; String[] temp = new String[2]; while (!arr[i][0].equals(null)) { for (int j = 0; j < 2; j++) { if (j == 0) { temp[j] = section; } else { temp[j] = arr[i][j - 1]; } this.myAdd(temp); } i = i + 1; } }