K
- V
- class ReferenceMap<K,V> extends AbstractMap<K,V> implements Map<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
private Set<Map.Entry<K,V>> |
entrys |
private Ref |
key |
private Set<K> |
keys |
private ReferenceQueuingFactory<K,Referrer<K>> |
krqf |
private Map<Referrer<K>,Referrer<V>> |
map |
private Ref |
val |
private Collection<V> |
values |
private ReferenceQueuingFactory<V,Referrer<V>> |
vrqf |
Constructor and Description |
---|
ReferenceMap(Map<Referrer<K>,Referrer<V>> map,
ReferenceQueuingFactory<K,Referrer<K>> krqf,
ReferenceQueuingFactory<V,Referrer<V>> vrqf,
Ref key,
Ref val) |
ReferenceMap(Map<Referrer<K>,Referrer<V>> map,
Ref key,
Ref val,
boolean gcThreads,
long gcKeyCycle,
long gcValCycle) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all associations from this map.
|
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet()
Returns a Set view of the mappings contained in the underlying map.
|
V |
get(Object key)
Returns value associated with given key, or null if none.
|
(package private) ReferenceQueuingFactory<K,Referrer<K>> |
getKeyRQF() |
(package private) ReferenceQueuingFactory<V,Referrer<V>> |
getValRQF() |
boolean |
isEmpty() |
(package private) Ref |
keyRef() |
Set<K> |
keySet()
The key Set returned, is encapsulated by ReferenceSet, which encapsulates
it's objects using the same Ref type as ReferenceMap
|
void |
processQueue() |
V |
put(K key,
V value)
Associates value with given key, returning value previously associated
with key, or null if none.
|
V |
remove(Object key)
Removes association for given key, returning value previously associated
with key, or null if none.
|
int |
size() |
(package private) Ref |
valRef() |
Collection<V> |
values()
Returns collection containing all values currently held in this map.
|
(package private) Referrer<K> |
wrapKey(K key,
boolean enque,
boolean temporary) |
(package private) Referrer<V> |
wrapVal(V val,
boolean enque,
boolean temporary) |
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll
private final ReferenceQueuingFactory<K,Referrer<K>> krqf
private final ReferenceQueuingFactory<V,Referrer<V>> vrqf
private final Ref key
private final Ref val
private final Collection<V> values
ReferenceMap(Map<Referrer<K>,Referrer<V>> map, Ref key, Ref val, boolean gcThreads, long gcKeyCycle, long gcValCycle)
ReferenceQueuingFactory<K,Referrer<K>> getKeyRQF()
ReferenceQueuingFactory<V,Referrer<V>> getValRQF()
Ref keyRef()
Ref valRef()
public void clear()
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public Set<Map.Entry<K,V>> entrySet()
public boolean isEmpty()
public Set<K> keySet()
keySet
in interface Map<K,V>
keySet
in class AbstractMap<K,V>
Ref
,
ReferenceSet
public void processQueue()
public V put(K key, V value)
public V remove(Object key)
public int size()
public Collection<V> values()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.