static final class LocalCache.AccessQueue<K,V> extends java.util.AbstractQueue<LocalCache.ReferenceEntry<K,V>>
ReferenceEntry
, upon which it reliese 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) LocalCache.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<LocalCache.ReferenceEntry<K,V>> |
iterator() |
boolean |
offer(LocalCache.ReferenceEntry<K,V> entry) |
LocalCache.ReferenceEntry<K,V> |
peek() |
LocalCache.ReferenceEntry<K,V> |
poll() |
boolean |
remove(java.lang.Object o) |
int |
size() |
containsAll, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
final LocalCache.ReferenceEntry<K,V> head
public boolean offer(LocalCache.ReferenceEntry<K,V> entry)
public LocalCache.ReferenceEntry<K,V> peek()
public LocalCache.ReferenceEntry<K,V> poll()
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<LocalCache.ReferenceEntry<K,V>>
remove
in class java.util.AbstractCollection<LocalCache.ReferenceEntry<K,V>>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<LocalCache.ReferenceEntry<K,V>>
contains
in class java.util.AbstractCollection<LocalCache.ReferenceEntry<K,V>>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<LocalCache.ReferenceEntry<K,V>>
isEmpty
in class java.util.AbstractCollection<LocalCache.ReferenceEntry<K,V>>
public int size()
size
in interface java.util.Collection<LocalCache.ReferenceEntry<K,V>>
size
in class java.util.AbstractCollection<LocalCache.ReferenceEntry<K,V>>
public void clear()
clear
in interface java.util.Collection<LocalCache.ReferenceEntry<K,V>>
clear
in class java.util.AbstractQueue<LocalCache.ReferenceEntry<K,V>>
public java.util.Iterator<LocalCache.ReferenceEntry<K,V>> iterator()
iterator
in interface java.lang.Iterable<LocalCache.ReferenceEntry<K,V>>
iterator
in interface java.util.Collection<LocalCache.ReferenceEntry<K,V>>
iterator
in class java.util.AbstractCollection<LocalCache.ReferenceEntry<K,V>>