for(Object[] objects : list){
map.put(objects[0].toString(), null);
}
for(Map.Entry<String, List<String>> entry:map.entrySet()){
entry.setValue(new ArrayList<String>());
}
for(Object[] objects : list){
String value = objects[1].toString();
if(value != null ){
map.get(objects[0].toString()).add(objects[1].toString());
}
}
JAVA将快速将列表分组并排序键
原创
©著作权归作者所有:来自51CTO博客作者小聪聪博客的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:将json数据回显到form表单
下一篇:fastJson转换对象与字符串
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
JAVA list基础操作
list基本操作
System List Test -
java中param定义list数组 java定义数组并排序
一、数组(1)概念 同一种类型数据的集合。其实数组就是一个容器。 (2)数组的好处 &nbs
java中param定义list数组 java 技术 System 数组 -
android list 按照英文排序 android数组排序
Android 基于 Comparator 对象列表数组排序在特定的需求下,有时需要对数据进行排序。 一般如果是单一基本数据类型或者String对象,比较容易排序。但是实际开发中往往是对象数组的排序,排序条件为对象中的某个属性。 这种情况下,建议使用 Comparator 进行排序。一、List< String > 和 Arrays 排序基本数据类型和String对象的用法是一样的
android list 按照英文排序 Comparator compareTo compare Comparable