java 遍历 map对象 很暴力想得到什么就得到什么

Map<String,MateMatrix> mate=cahe.getAllMateMatrixs();

Set<Map.Entry<String,MateMatrix>> set = mate.entrySet();
 
for(Iterator<Map.Entry<String, MateMatrix>> it = set.iterator(); it.hasNext();){
Map.Entry<String, MateMatrix> entry = (Map.Entry<String, MateMatrix>) it.next();
           System.out.println(entry.getKey() + "--->" + entry.getValue().getDescription());
}

猜你喜欢

转载自blog.csdn.net/linwei_hello/article/details/10464219