Java LinkedHashMap???????????
???????????? ???????[ 2016/3/24 11:10:29 ] ??????????????????? ???????
????afterNodeAccess????
void afterNodeAccess(Node<K??V> e) { // move node to last
LinkedHashMap.Entry<K??V> last;
// ?????????accessOrder????????????????????
if (accessOrder && (last = tail) != e) {
LinkedHashMap.Entry<K??V> p =
(LinkedHashMap.Entry<K??V>)e?? b = p.before?? a = p.after;
p.after = null;
if (b == null)
head = a;
else
b.after = a;
if (a != null)
a.before = b;
else
last = b;
if (last == null)
head = p;
else {
p.before = last;
last.after = p;
}
tail = p;
++modCount;
}
}
????????????put???????????????????????????????????????????????????????
????afterNodeInsertion????
????void afterNodeInsertion(boolean evict) { // possibly remove eldest
????LinkedHashMap.Entry<K??V> first;
????// ?????????????????????????????
????if (evict && (first = head) != null && removeEldestEntry(first)) {
????K key = first.key;
????removeNode(hash(key)?? key?? null?? false?? true);
????}
????}
????????????????removeEldestEntry??????????????????????????????
????afterNodeRemoval????
????void afterNodeRemoval(Node<K??V> e) { // unlink
????// ??????????????
????LinkedHashMap.Entry<K??V> p =
????(LinkedHashMap.Entry<K??V>)e?? b = p.before?? a = p.after;
????p.before = p.after = null;
????if (b == null)
????head = a;
????else
????b.after = a;
????if (a == null)
????tail = b;
????else
????a.before = b;
????}
????????????????????????????????????????????????
?????????????3????????????????????????????????????е???????????????????????????Щ????????飬????????????????н?????????eldest??youngest??
????3. put??get????
????put??????LinkedHashMap??δ????????????????afterNodeAccess??afterNodeInsertion?????????????get????????????????????afterNodeAccess??????????????????get?????????????
????public V get(Object key) {
????Node<K??V> e;
????if ((e = getNode(hash(key)?? key)) == null)
????return null;
????if (accessOrder)
????afterNodeAccess(e);
????return e.value;
????}
????????????????accessOrder???£??????get????put???????????????structural modification????????????????????
????A structural modification is any operation that adds or deletes one or more mappings or?? in the case of access-ordered linked hash maps?? affects iteration order. In insertion-ordered linked hash maps?? merely changing the value associated with a key that is already contained in the map is not a structural modification. In access-ordered linked hash maps?? merely querying the map with get is a structural modification.
?????????????ConcurrentModificationException with LinkedHashMap?????????
?????????LinkedHashMap??????HashMap???????????????????????????????????????LinkedHashMap???????????????????????????????????з???????????????:-)
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????