随笔分类 -  JavaSE---Collection

Map---WeakHashMap
摘要:概述 Hash table based implementation of the <tt>Map</tt> interface, with <em>weak keys</em>.An entry in a <tt>WeakHashMap</tt> will automatically be rem 阅读全文

posted @ 2023-11-24 19:55 anpeiyong 阅读(4) 评论(0) 推荐(0) 编辑

Map---IdentityHashMap
摘要:总结 Java 中的一种特殊类型的哈希表,它基于对象的引用(即对象的内存地址)而不是对象的内容来进行键值对的存储和查找。这意味着在 IdentityHashMap 中,两个对象即使内容相同,但如果它们不是同一个对象实例(即内存地址不同),也会被视为不同的键。 基于引用比较: IdentityHash 阅读全文

posted @ 2023-11-15 14:42 anpeiyong 阅读(13) 评论(0) 推荐(0) 编辑

List---Deque-LinkedList
摘要:概述 Doubly-linked list implementation of the {@code List} and {@code Deque} interfaces. Implements all optional list operations, and permits all elemen 阅读全文

posted @ 2023-11-10 15:52 anpeiyong 阅读(7) 评论(0) 推荐(0) 编辑

Queue&Deque
摘要:Queue 概述 A collection designed for holding elements prior to processing.Besides basic {@link java.util.Collection Collection} operations, queues provi 阅读全文

posted @ 2023-11-10 15:22 anpeiyong 阅读(11) 评论(0) 推荐(0) 编辑

Iterable&Iterator&Collection
摘要:Iterable 概述 Implementing this interface allows an object to be the target of the "for-each loop" statement. 实现Iterable接口 允许一个对象 作为 foreach遍历的目标; publi 阅读全文

posted @ 2023-11-10 10:05 anpeiyong 阅读(5) 评论(0) 推荐(0) 编辑

Set&List&Map
摘要:Map 概述 An object that maps keys to values. A map cannot contain duplicate keys; each key can map to at most one value. Map将key映射到value; Map的key不能重复,每个 阅读全文

posted @ 2023-11-09 19:39 anpeiyong 阅读(8) 评论(0) 推荐(0) 编辑

Set---HashSet-LinkedHashSet
摘要:概述 Hash table and linked list implementation of the <tt>Set</tt> interface, with predictable iteration order. This implementation differs from <tt>Has 阅读全文

posted @ 2023-11-09 11:24 anpeiyong 阅读(10) 评论(0) 推荐(0) 编辑

Set---SortedSet-NavigableSet-TreeSet
摘要:SortedSet 概述 A {@link Set} that further provides a <i>total ordering</i> on its elements.The elements are ordered using their {@linkplain Comparable n 阅读全文

posted @ 2023-11-08 19:05 anpeiyong 阅读(12) 评论(0) 推荐(0) 编辑

Map---SortedMap-NavigableMap-TreeMap
摘要:SortedMap 概述 A {@link Map} that further provides a <em>total ordering</em> on its keys.The map is ordered according to the {@linkplain Comparable natu 阅读全文

posted @ 2023-11-08 16:19 anpeiyong 阅读(20) 评论(0) 推荐(0) 编辑

Set---HashSet
摘要:概述 This class implements the <tt>Set</tt> interface, backed by a hash table (actually a <tt>HashMap</tt> instance). It makes no guarantees as to the i 阅读全文

posted @ 2023-11-08 11:27 anpeiyong 阅读(6) 评论(0) 推荐(0) 编辑

Map---HashMap---jdk8
摘要:总结 为什么取模运算只需要看对应二进制的后几位? 比如,a % b 正常取模,只需要看 a - b*n,只需要看 <b的值; 换算成 二进制, b 是 2的几次方, HashMap的key有什么要求? 需要实现 equals和hashcode 方法; Hash函数是怎么实现的? static fin 阅读全文

posted @ 2023-11-08 10:23 anpeiyong 阅读(13) 评论(0) 推荐(0) 编辑

Map---HashMap-LinkedHashMap
摘要:概述 LinkedHashMap是HashMap的直接子类; 二者唯一的区别是LinkedHashMap在HashMap的基础上,采用双向链表(doubly-linked list)的形式将所有entry连接起来,这样是为保证元素的迭代顺序跟插入顺序相同。 上图给出了LinkedHashMap的结构 阅读全文

posted @ 2023-11-07 11:02 anpeiyong 阅读(123) 评论(0) 推荐(0) 编辑

Collections
摘要:synchronized ArrayList相关 Collections.synchronizedList(new ArrayList<>()) public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomA 阅读全文

posted @ 2023-10-30 15:49 anpeiyong 阅读(10) 评论(0) 推荐(0) 编辑

List---ArrayList
摘要:概述 Resizable-array implementation of the <tt>List</tt> interface. Implements all optional list operations, and permits all elements, including <tt>nul 阅读全文

posted @ 2023-10-30 15:43 anpeiyong 阅读(7) 评论(0) 推荐(0) 编辑

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示