LinkedHashMap.this.remove(lastReturned.key); lastReturned = null; expectedModCount = modCount; } Entry<K,V> nextEntry() { // 迭代输出双向链表各节点 if (modCount != expectedModCount) throw new ConcurrentModificationException(); if (nextEntry == header) throw new NoSuchElementException(); ...
}Entry<K,V> nextEntry() {// 迭代输出双向链表各节点if(modCount != expectedModCount)thrownewConcurrentModificationException();if(nextEntry == header)thrownewNoSuchElementException();Entry<K,V> e = lastReturned = nextEntry; nextEntry = e.after;returne; } }// Key 迭代器,KeySetprivateclassKe...
//创建新的Entry,并插入到LinkedHashMap中createEntry(hash,key, value, bucketIndex);// 重写了HashMap中的createEntry方法//双向链表的第一个有效节点(header后的那个节点)为最近最少使用的节点,这是用来支持LRU算法的Entry<K,V> eldest = header.after;//如果有必要,则删除掉该近期最少使用的节点,//这要...
(except through the iterator's ownremoveoperation, or through thesetValueoperation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via theIterator.remove,Set.remove,...
Like HashMap, it provides constant-time performance for the basic operations (add, contains and remove), assuming the hash function disperses elements properly among the buckets. Performance is likely to be just slightly below that of HashMap, due to the added expense of maintaining the linked ...
0 - This is a modal window. No compatible source was found for this media. Kickstart YourCareer Get certified by completing the course Get Started Print Page PreviousNext
This implementation merely returns false (so that this map acts like a normal map - the eldest element is never removed). Parameters: eldest - The least recently inserted entry in the map, or if this is an access-ordered map, the least recently accessed entry. Th...
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your...
EntrySet() Returns a Set view of the mappings contained in this map. (Inherited from HashMap) Equals(Object) Indicates whether some other object is "equal to" this one. (Inherited from Object) ForEach(IBiConsumer) (Inherited from HashMap) Get(Object) To be added (Inherited from ...
If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes ...