在平时工作之中,JDK中某个接口或类的用法知道个大概,却没有对其源码进行阅读,今晚趁着睡觉前,对Map源码进行快速的阅读,做一下笔记,以便后续翻看。
一、Map接口中有什么呢
以JDK1.8为阅读版本,Map接口里面有:
1个
内部接口——Map.Entry25个
接口方法
interface Entry
clear
compute
computeIfAbsent
computeIfPresent
containsKey
containsValue
entrySet
equals
forEach
get
getOrDefault
hashCode
isEmpty
keySet
merge
put
putAll
putIfAbsent
remove
remove
replace
replace
replaceAll
size
说明:返回map中键 - 值对的数量。如果map包含多于Integer.MAX_VALUE个元素,则返回Integer.MAX_VALUE。
白话文:方法返回值R取值范围为: R >= 0 && R <= 2147483647
values