PSP |
任務內容 |
計劃時間(min) |
完成時間(min) |
Planning |
計劃 |
30 |
60 |
Estimate |
估計這個任務須要多少時間,並規劃大體工做步驟 |
30 |
60 |
Development |
開發 |
630 |
910 |
Analysis |
需求分析 |
40 |
60 |
Design Spec |
生成文檔 |
20 |
30 |
Design Review |
設計複審 |
0 |
0 |
Coding Standard |
代碼規範 |
20 |
40 |
Design |
具體設計 |
60 |
120 |
Coding |
具體編碼 |
420 |
540 |
Code Review |
代碼複審 |
30 |
40 |
Test |
測試 |
30 |
80 |
Reporting |
報告 |
160 |
400 |
Test Report |
測試報告 |
120 |
120 |
Size Measurement |
計算工做量 |
20 |
30 |
Postmortem & Process Improvement Plan |
過後總結, 並提出過程改進計劃 |
30 |
50 |
功能模塊 |
具體階段 |
預計時間(min) |
實際時間(min) |
功能1 |
具體設計具體編碼測試完善 |
2012010 |
3015020 |
功能2 |
具體設計具體編碼測試完善 |
2015010 |
4015025 |
功能3 |
具體設計具體編碼測試完善 |
2015010 |
5024035 |
String str=characters.toString().toLowerCase();//將字符所有轉化爲小寫 String[] word = str.split("[^a-zA-Z0-9]");//按空格和非字母進行分割 int num =0; Map<String,Integer> myMap = new TreeMap<String,Integer>();//分割後存入數組 //遍歷數組將其存入Map<String,Integer>中 String regex="^[a-zA-Z][a-zA-Z0-9]*$"; Pattern p = Pattern.compile(regex); for(int i=0;i<word.length;i++) { Matcher m =p.matcher(word[i]); if(m.matches()) { if(myMap.containsKey(word[i])) { num = myMap.get(word[i]); myMap.put(word[i], num+1); } else { myMap.put(word[i], 1); } } }//判斷是否爲合法單詞 將合法單詞存入Map
List<Map.Entry<String, Integer>> list =new ArrayList<Map.Entry<String,Integer>>(myMap.entrySet());//Map轉換成list進行排序 System.out.println("total"+" "+list.size()+"\n"); for(int i=0;i<word.length;i++) { if(myMap.containsKey(word[i])) { System.out.println(word[i]+" "+myMap.get(word[i])); myMap.remove(word[i]); }//在Map集合中不該該利用get()方法來判斷是否存在某個鍵,而應該利用containsKey()方法來判斷 } bufferedReader.close();
public String readDir(String filepath){ File file = new File(filepath); String[] filelist = file.list(); String[] characterlist = new String [filelist.length]; for(int i=0;i<filelist.length;i++) { File readfile = new File(filepath+"\\"+filelist[i]); characterlist[i]=readfile.getName(); } List<String> list = (List<String>)Arrays.asList(characterlist); Collections.sort(list); String[] paths = list.toArray(new String[0]); return paths[0]; }// 使用readDir()函數讀取某文件夾下的全部文件
Collections.sort(list,new Comparator<Map.Entry<String, Integer>>(){ public int compare(Entry<String,Integer> e1,Entry<String,Integer> e2) { return e2.getValue().compareTo(e1.getValue()); } }); //使用比較器進行排序