设为首页 加入收藏

TOP

基于JDK1.8的ConcurrentHashMap分析(三)
2018-03-02 06:57:04 】 浏览:479
Tags:基于 JDK1.8 ConcurrentHashMap分析
sp;           if ((ek = e.key) == key || (ek != null && key.equals(ek)))
                return e.val;
        }
        else if (eh < 0)
            return (p = e.find(h, key)) != null ? p.val : null;
        while ((e = e.next) != null) {
            if (e.hash == h &&
                ((ek = e.key) == key || (ek != null && key.equals(ek))))
                return e.val;
        }
    }
    return null;
}


和HashMap的get方法大同小异。没有涉及到并发操作。直接取到key的hash值,如果是第一个节点,直接返回。否则while循环查找。


首页 上一页 1 2 3 4 5 下一页 尾页 3/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Uboot 引导内核时加载地址与入口.. 下一篇解决PyCharm无法显示matplotlib绘..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目