資源簡介
南京大學軟件學院2009級軟件體系結構大作業,分為6項,包括項目的開發視圖,部署試圖

代碼片段和文件信息
package?nju.edu.mc;
import?java.io.BufferedReader;
import?java.io.File;
import?java.io.FileNotFoundException;
import?java.io.FileOutputStream;
import?java.io.FileReader;
import?java.io.IOException;
import?java.io.PrintWriter;
import?java.util.ArrayList;
import?java.util.Scanner;
import?java.util.StringTokenizer;
public?class?Main?{
private?static?ArrayList?kwicList?=?new?ArrayList();
private?static?String?textLine;
private?static?ArrayList?shiftedLineIndexes;
private?static?ArrayList?sortedLineIndexes;
protected?static?BufferedReader?input(String?InputFilename){
BufferedReader?input_file?=?null;
try?{
input_file?=?new?BufferedReader(new?FileReader(InputFilename));
}?catch?(IOException?e)?{
System.err.println((“文件無法打開“?+?e.toString()));
System.exit(1);
}
return?input_file;
}
protected?static?void?circularShift(BufferedReader?br){
int?countIndex?=?0;
try?{
while(br.ready()){
String?line?=?br.readLine();
textLine?=?textLine+line+“?“;
StringTokenizer?tokener?=?new?StringTokenizer(line);
int?index=0;
ArrayList?tokensIndex?=?new?ArrayList();
int?count?=?tokener.countTokens();
countIndex++;
shiftedLineIndexes.add(countIndex);
tokensIndex.add(countIndex);
for(int?t=0;t countIndex++;
if(line.substring(tt+1).equals(“?“)){
tokensIndex.add(countIndex);
shiftedLineIndexes.add(countIndex);
//System.out.print(countIndex+“?“);
}
}
for?(int?i?=?0;?i? index=i;
int[]?tempInt?=?new?int[count];
for?(int?j?=?0;?j?
if?(index?>=?count)
??????????index?=?0;
tempInt[j]=tokensIndex.get(index);
//System.out.print(tempInt[j]+“?“);
????index++;
}
kwicList.add(tempInt);
//System.out.println(““);
}
}
/*for(int?i=0;i System.out.print(shiftedLineIndexes.get(i)+“?“);
}*/
}?catch?(IOException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
//System.out.println(textLine);
}
protected?static?void?alphabetizer(){
ArrayList?strList?=?new?ArrayList();
ArrayListsortedIndexes?=?kwicList;
for(int?i=0;i String?thisStr=““;
for(int?j=0;j int?index?=?kwicList.get(i)[j];
//System.out.println(textLine);
for(int?m=0;m if(shiftedLineIndexes.get(m)==index){
if(m==shiftedLineIndexes.size()-1)
thisStr?=?thisStr+textLine.substring(index-1);
else
thisStr?=?thisStr+textLine.substring(index-1shiftedLineIndexes.get(m+1)-1);
}
}
}
//System.out.println(thisStr);
strList.add(thisStr);
}
for(int?i=0;i for(int?j=0;j
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????301??2012-05-24?10:34??KWIC_hw5\.classpath
?????文件????????384??2012-05-24?10:34??KWIC_hw5\.project
?????文件????????629??2012-05-24?10:34??KWIC_hw5\.settings\org.eclipse.jdt.core.prefs
?????文件???????2891??2012-05-24?11:41??KWIC_hw5\bin\nju\edu\mc\Alphabetizer.class
?????文件???????2119??2012-05-24?11:41??KWIC_hw5\bin\nju\edu\mc\CircularShifter.class
?????文件????????999??2012-05-24?11:29??KWIC_hw5\bin\nju\edu\mc\Filter.class
?????文件???????1665??2012-05-24?11:40??KWIC_hw5\bin\nju\edu\mc\Inputer.class
?????文件???????2500??2012-05-24?11:32??KWIC_hw5\bin\nju\edu\mc\Main.class
?????文件???????1451??2012-05-24?11:38??KWIC_hw5\bin\nju\edu\mc\Outputer.class
?????文件???????1760??2012-05-24?11:40??KWIC_hw5\bin\nju\edu\mc\TextLinePipe.class
?????文件?????????27??2012-05-23?21:51??KWIC_hw5\input.txt
?????文件?????????58??2012-05-24?15:04??KWIC_hw5\output.txt
?????文件???????1896??2012-05-24?11:41??KWIC_hw5\src\nju\edu\mc\Alphabetizer.java
?????文件???????1286??2012-05-24?11:41??KWIC_hw5\src\nju\edu\mc\CircularShifter.java
?????文件????????630??2012-05-24?11:29??KWIC_hw5\src\nju\edu\mc\Filter.java
?????文件????????894??2012-05-24?11:39??KWIC_hw5\src\nju\edu\mc\Inputer.java
?????文件???????1639??2012-05-24?11:32??KWIC_hw5\src\nju\edu\mc\Main.java
?????文件????????801??2012-05-24?11:38??KWIC_hw5\src\nju\edu\mc\Outputer.java
?????文件???????1193??2012-05-24?11:40??KWIC_hw5\src\nju\edu\mc\TextLinePipe.java
?????文件????????301??2012-05-24?09:17??KWIC_hw4\.classpath
?????文件????????384??2012-05-24?10:28??KWIC_hw4\.project
?????文件????????629??2012-05-24?09:17??KWIC_hw4\.settings\org.eclipse.jdt.core.prefs
?????文件???????2675??2012-05-24?10:28??KWIC_hw4\bin\nju\edu\mc\Alphabetizer.class
?????文件???????1903??2012-05-24?10:28??KWIC_hw4\bin\nju\edu\mc\CircularShifter.class
?????文件????????854??2012-05-24?10:28??KWIC_hw4\bin\nju\edu\mc\Filter.class
?????文件???????1565??2012-05-24?10:28??KWIC_hw4\bin\nju\edu\mc\Inputer.class
?????文件???????2482??2012-05-24?10:28??KWIC_hw4\bin\nju\edu\mc\Main.class
?????文件???????1256??2012-05-24?10:28??KWIC_hw4\bin\nju\edu\mc\Outputer.class
?????文件???????1438??2012-05-24?10:28??KWIC_hw4\bin\nju\edu\mc\TextLinePipe.class
?????文件?????????27??2012-05-23?21:51??KWIC_hw4\input.txt
............此處省略133個文件信息
- 上一篇:STM32基于GPRS以mqtt協議與onenet通信
- 下一篇:自動保存更改記錄
評論
共有 條評論