public abstract class FactoryMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
create(Object)
method) on first get(Object)
access.
This map is NOT THREAD SAFE.
For the thread-safe alternative please use ConcurrentFactoryMap
instead.Constructor and Description |
---|
FactoryMap()
Deprecated.
Use
create(Function) instead |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
static <K,V> java.util.Map<K,V> |
create(Function<? super K,? extends V> computeValue) |
protected abstract V |
create(K key) |
protected java.util.Map<K,V> |
createMap() |
static <K,V> java.util.Map<K,V> |
createMap(Function<? super K,? extends V> computeValue,
java.util.function.Supplier<? extends java.util.Map<K,V>> mapCreator) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key) |
boolean |
removeValue(java.lang.Object value) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<V> |
values() |
@Deprecated public FactoryMap()
create(Function)
insteadpublic final boolean containsKey(java.lang.Object key)
public boolean removeValue(java.lang.Object value)
public boolean containsValue(java.lang.Object value)
public java.lang.String toString()
toString
in class java.lang.Object
public static <K,V> java.util.Map<K,V> create(Function<? super K,? extends V> computeValue)
public static <K,V> java.util.Map<K,V> createMap(Function<? super K,? extends V> computeValue, java.util.function.Supplier<? extends java.util.Map<K,V>> mapCreator)