Package org.arakhne.afc.references
Class AbstractPhantomValueMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.arakhne.afc.references.AbstractReferencedValueMap<K,V>
-
- org.arakhne.afc.references.AbstractPhantomValueMap<K,V>
-
- Type Parameters:
K
- is the type of the keys.V
- is the type of the values.
- All Implemented Interfaces:
Map<K,V>
- Direct Known Subclasses:
PhantomValueHashMap
,PhantomValueTreeMap
public abstract class AbstractPhantomValueMap<K,V> extends AbstractReferencedValueMap<K,V>
A Map implementation withphantom values
. An entry in a AbstractPhantomValueMap will automatically be removed when its value is no longer in ordinary use ornull
.This abstract implementation does not decide if the map is based on a tree or on a hashtable.
- Since:
- 5.8
- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- references
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.arakhne.afc.references.AbstractReferencedValueMap
AbstractReferencedValueMap.PhantomReferencedValue<VKT,VVT>, AbstractReferencedValueMap.ReferencableValue<K,V>, AbstractReferencedValueMap.SoftReferencedValue<VKT,VVT>, AbstractReferencedValueMap.WeakReferencedValue<VKT,VVT>
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.references.AbstractReferencedValueMap
map, NULL_VALUE
-
-
Constructor Summary
Constructors Constructor Description AbstractPhantomValueMap(Map<K,AbstractReferencedValueMap.ReferencableValue<K,V>> map)
Constructs an empty Map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AbstractReferencedValueMap.ReferencableValue<K,V>
makeValue(K key, V value, ReferenceQueue<V> queue)
Create a storage object that permits to put the specified elements inside this map.-
Methods inherited from class org.arakhne.afc.references.AbstractReferencedValueMap
entrySet, equals, expurge, expurgeNow, expurgeQueuedReferences, finishToArray, hashCode, isDeeplyExpurge, makeValue, maskNull, put, setDeeplyExpurge, unmaskNull
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, get, isEmpty, keySet, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
AbstractPhantomValueMap
public AbstractPhantomValueMap(Map<K,AbstractReferencedValueMap.ReferencableValue<K,V>> map)
Constructs an empty Map.- Parameters:
map
- is the map instance to use to store the entries.- Throws:
IllegalArgumentException
- if the initial capacity is negative or the load factor is nonpositive
-
-
Method Detail
-
makeValue
protected final AbstractReferencedValueMap.ReferencableValue<K,V> makeValue(K key, V value, ReferenceQueue<V> queue)
Description copied from class:AbstractReferencedValueMap
Create a storage object that permits to put the specified elements inside this map.- Specified by:
makeValue
in classAbstractReferencedValueMap<K,V>
- Parameters:
key
- is the key associated to the valuevalue
- is the valuequeue
- is the reference queue to use- Returns:
- the new storage object
-
-