Class LocalCache.AccessQueue<K,V>

java.lang.Object
java.util.AbstractCollection<ReferenceEntry<K,V>>
java.util.AbstractQueue<ReferenceEntry<K,V>>
com.google.common.cache.LocalCache.AccessQueue<K,V>
All Implemented Interfaces:
Iterable<ReferenceEntry<K,V>>, Collection<ReferenceEntry<K,V>>, Queue<ReferenceEntry<K,V>>
Enclosing class:
LocalCache<K,V>

static final class LocalCache.AccessQueue<K,V> extends AbstractQueue<ReferenceEntry<K,V>>
A custom queue for managing access order. Note that this is tightly integrated with ReferenceEntry, upon which it relies to perform its linking.

Note that this entire implementation makes the assumption that all elements which are in the map are also in this queue, and that all elements not in the queue are not in the map.

The benefits of creating our own queue are that (1) we can replace elements in the middle of the queue as part of copyWriteEntry, and (2) the contains method is highly optimized for the current model.