public Map<String,ArrayList> separete(List list){
TreeMap tm=new TreeMap();
for(int i=0;i<list.size();i++){
HuaweiStation s=(HuaweiStation)list.get(i);
if(tm.containsKey(s.getBustime())){
ArrayList l11=(ArrayList)tm.get(s.getBustime());
l11.add(s);
}else{
ArrayList tem=new ArrayList();
tem.add(s);
tm.put(s.getBustime(), tem);
}
}
return tm;
}
使用TreeMap分离并整合数据
本文介绍了一种使用TreeMap来分离并整合数据的方法,通过遍历List并利用TreeMap的特性,实现数据的高效分组与整合。
3895

被折叠的 条评论
为什么被折叠?



