日期:2014-05-17 浏览次数:20712 次
package csdn;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
public class Num {
public HashMap<String, WuPin> wupins = new HashMap<String, WuPin>();
public Num(String num){
String[] strs = num.split("[
------解决方案--------------------
]");
for(String str : strs){
String[] str_wupin = str.split(",");
wupins.put(str_wupin[0], new WuPin(str_wupin[0], str_wupin[1]));
}
}
public String toString(){
String result = "";
Iterator<Entry<String, WuPin>> iter = wupins.entrySet().iterator();
while (iter.hasNext()) {
if (result.length() > 0){
result = result + "