java8的map有了很大的增强
1.更改存储结构,比如hashmap,从数组加链表变成了数组加链表加红黑树
2.新方法:
compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
forEach(BiConsumer<? super K,? super V> action)
getOrDefault(Object key, V defaultValue)
merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
putIfAbsent(K key, V value)
remove(Object key, Object value)
replace(K key, V oldValue, V newValue)
replaceAll(BiFunction<? super K,? super V,? extends V> function)