K - the key typeV - the value typepublic abstract class ReferenceValueMap<K,V>
extends java.util.AbstractMap<K,V>
| Modifier and Type | Class and Description |
|---|---|
private class |
ReferenceValueMap.EntrySet
EntrySet.
|
private class |
ReferenceValueMap.EntrySetIterator
EntrySet iterator
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<K,ValueRef<K,V>> |
map
Hash table mapping keys to ref values
|
private java.lang.ref.ReferenceQueue<V> |
queue
Reference queue for cleared RefKeys
|
| Modifier | Constructor and Description |
|---|---|
protected |
ReferenceValueMap() |
protected |
ReferenceValueMap(java.util.Comparator<K> comparator) |
protected |
ReferenceValueMap(int initialCapacity) |
protected |
ReferenceValueMap(int initialCapacity,
float loadFactor) |
protected |
ReferenceValueMap(java.util.Map<K,V> t) |
protected |
ReferenceValueMap(java.util.SortedMap<K,ValueRef<K,V>> sorted) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
protected abstract ValueRef<K,V> |
create(K key,
V value,
java.lang.ref.ReferenceQueue<V> q)
Create new value ref instance.
|
protected abstract java.util.Map<K,ValueRef<K,V>> |
createMap()
Create map.
|
protected abstract java.util.Map<K,ValueRef<K,V>> |
createMap(java.util.Comparator<K> comparator)
Create map.
|
protected abstract java.util.Map<K,ValueRef<K,V>> |
createMap(int initialCapacity)
Create map.
|
protected abstract java.util.Map<K,ValueRef<K,V>> |
createMap(int initialCapacity,
float loadFactor)
Create map.
|
protected abstract java.util.Map<K,ValueRef<K,V>> |
createMap(java.util.SortedMap<K,ValueRef<K,V>> map)
Create map.
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
private void |
processQueue()
Remove all entries whose values have been discarded.
|
V |
put(K key,
V value) |
V |
remove(java.lang.Object key) |
int |
size() |
java.lang.String |
toString() |
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, valuesprivate java.lang.ref.ReferenceQueue<V> queue
protected ReferenceValueMap()
protected ReferenceValueMap(int initialCapacity)
protected ReferenceValueMap(int initialCapacity,
float loadFactor)
protected ReferenceValueMap(java.util.Comparator<K> comparator)
protected abstract java.util.Map<K,ValueRef<K,V>> createMap()
protected abstract java.util.Map<K,ValueRef<K,V>> createMap(int initialCapacity)
initialCapacity - the initial capacityprotected abstract java.util.Map<K,ValueRef<K,V>> createMap(int initialCapacity, float loadFactor)
initialCapacity - the initial capacityloadFactor - the load factorprotected abstract java.util.Map<K,ValueRef<K,V>> createMap(java.util.Comparator<K> comparator)
comparator - the comparatorprotected abstract java.util.Map<K,ValueRef<K,V>> createMap(java.util.SortedMap<K,ValueRef<K,V>> map)
map - the sorted mappublic int size()
public boolean containsKey(java.lang.Object key)
public V get(java.lang.Object key)
public V remove(java.lang.Object key)
public void clear()
private void processQueue()
protected abstract ValueRef<K,V> create(K key, V value, java.lang.ref.ReferenceQueue<V> q)
key - the keyvalue - the valueq - the ref queue