static final class LocalCache.AccessQueue<K,V> extends java.util.AbstractQueue<ReferenceEntry<K,V>>
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.
| Modifier and Type | Field and Description |
|---|---|
(package private) ReferenceEntry<K,V> |
head |
| Constructor and Description |
|---|
AccessQueue() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
isEmpty() |
java.util.Iterator<ReferenceEntry<K,V>> |
iterator() |
boolean |
offer(ReferenceEntry<K,V> entry) |
ReferenceEntry<K,V> |
peek() |
ReferenceEntry<K,V> |
poll() |
boolean |
remove(java.lang.Object o) |
int |
size() |
containsAll, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfinal ReferenceEntry<K,V> head
public boolean offer(ReferenceEntry<K,V> entry)
public ReferenceEntry<K,V> peek()
public ReferenceEntry<K,V> poll()
public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<ReferenceEntry<K,V>>remove in class java.util.AbstractCollection<ReferenceEntry<K,V>>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<ReferenceEntry<K,V>>contains in class java.util.AbstractCollection<ReferenceEntry<K,V>>public boolean isEmpty()
isEmpty in interface java.util.Collection<ReferenceEntry<K,V>>isEmpty in class java.util.AbstractCollection<ReferenceEntry<K,V>>public int size()
size in interface java.util.Collection<ReferenceEntry<K,V>>size in class java.util.AbstractCollection<ReferenceEntry<K,V>>public void clear()
clear in interface java.util.Collection<ReferenceEntry<K,V>>clear in class java.util.AbstractQueue<ReferenceEntry<K,V>>public java.util.Iterator<ReferenceEntry<K,V>> iterator()
iterator in interface java.lang.Iterable<ReferenceEntry<K,V>>iterator in interface java.util.Collection<ReferenceEntry<K,V>>iterator in class java.util.AbstractCollection<ReferenceEntry<K,V>>