遍历Key
Set<String> set = map.keySet();
Iterator<String> iterator = set.iterator();
while(iterator.hasNext()){
String key = iterator.next();
}
遍历整个图的属性
Set<Map.Entry<String, Integer>> entries = map.entrySet();
for (Map.Entry<String, Integer> entry : entries) {
String key = entry.getKey();
Integer value = entry.getValue();
}
图的其他API
//判断是否为空
map.isEmpty();
//修改map的值,前提是得到key值
map.replace("",1);