java while 里的两个函数能用多线程老提高运行速度吗? 15
Map<String,Integer>m=newHashMap<String,Integer>();try{FileReaderfile=newFileReader("E...
Map<String, Integer> m = new HashMap<String, Integer>();
try{
FileReader file = new FileReader("E:/20150616-094841_hchb.wz.gr.csv");
BufferedReader br = new BufferedReader(file);
String s = "";
s = br.readLine();
Set<String> st = new LinkedHashSet<String>();
int count = 0;
while(( s = br.readLine())!=null){
boolean succeed = st.add(splitt(s));
if(succeed)
count++;
int freq = m.get(splitt2(s)) == null ?0:m.get(splitt2(s));
m.put(splitt2(s),freq==0 ? 1 : freq + 1);
} 展开
try{
FileReader file = new FileReader("E:/20150616-094841_hchb.wz.gr.csv");
BufferedReader br = new BufferedReader(file);
String s = "";
s = br.readLine();
Set<String> st = new LinkedHashSet<String>();
int count = 0;
while(( s = br.readLine())!=null){
boolean succeed = st.add(splitt(s));
if(succeed)
count++;
int freq = m.get(splitt2(s)) == null ?0:m.get(splitt2(s));
m.put(splitt2(s),freq==0 ? 1 : freq + 1);
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询