“LinkedHashMap”的版本间的差异
跳到导航
跳到搜索
Jihongchang(讨论 | 贡献) |
Jihongchang(讨论 | 贡献) |
||
第11行: | 第11行: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | [[文件:LinkedHashMap添加和取出顺序.png|无|缩略图]] | + | [[文件:LinkedHashMap添加和取出顺序.png|无|缩略图|替代=|1373x1373像素]]结点左边的“b”是 before 的意思,是指向前驱的引用类型变量; |
+ | |||
+ | 结点右边的“a”是 after 的意思,是指向后继的引用类型变量; | ||
+ | |||
+ | next 则是按照 hashcode 取模之后存储元素的hash槽的位置; |
2023年5月6日 (六) 10:46的版本
package java.util;
……
public class LinkedHashMap<K,V>
extends HashMap<K,V>
implements Map<K,V>
{
……
transient LinkedHashMap.Entry<K,V> head;
transient LinkedHashMap.Entry<K,V> tail;
}
结点左边的“b”是 before 的意思,是指向前驱的引用类型变量;
结点右边的“a”是 after 的意思,是指向后继的引用类型变量;
next 则是按照 hashcode 取模之后存储元素的hash槽的位置;