K
- KeyV
- Valuepublic class LoadingMap<K,V> extends AbstractMap<K,V>
Modifier and Type | Class and Description |
---|---|
static class |
LoadingMap.Feeder<T>
Due to java stuff, you will need to cast it to (Function) for some cases
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LoadingMap(Map<K,V> backingMap,
com.google.common.base.Function<K,V> loader)
Initializes an auto loading map using specified loader and backing map
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
LoadingMap<K,V> |
clone() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object o) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
static <K,V> Map<K,V> |
newAutoMap(Map<K,V> backingMap,
Class<? extends K> keyClass,
Class<? extends V> valueClass)
Creates a LoadingMap with an auto instantiating loader.
|
static <K,V> Map<K,V> |
newAutoMap(Map<K,V> backingMap,
Class<? extends V> valueClass)
Creates a LoadingMap with an auto instantiating loader.
|
static <K,V> Map<K,V> |
newHashAutoMap(Class<? extends K> keyClass,
Class<? extends V> valueClass) |
static <K,V> Map<K,V> |
newHashAutoMap(Class<? extends K> keyClass,
Class<? extends V> valueClass,
int initialCapacity,
float loadFactor) |
static <K,V> Map<K,V> |
newHashAutoMap(Class<? extends V> valueClass) |
static <K,V> Map<K,V> |
newHashAutoMap(Class<? extends V> valueClass,
int initialCapacity,
float loadFactor) |
static <K,V> Map<K,V> |
newHashMap(com.google.common.base.Function<K,V> loader)
Initializes an auto loading map using a HashMap
|
static <K,V> Map<K,V> |
newHashMap(com.google.common.base.Function<K,V> loader,
int initialCapacity,
float loadFactor)
Initializes an auto loading map using a HashMap
|
static <K,V> Map<K,V> |
newIdentityHashMap(com.google.common.base.Function<K,V> loader)
Initializes an auto loading map using an Identity HashMap
|
static <K,V> Map<K,V> |
newIdentityHashMap(com.google.common.base.Function<K,V> loader,
int initialCapacity)
Initializes an auto loading map using an Identity HashMap
|
static <K,V> Map<K,V> |
of(Map<K,V> backingMap,
com.google.common.base.Function<K,V> loader)
Creates a new LoadingMap with the specified map and loader
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
remove(Object key) |
int |
size() |
Collection<V> |
values() |
toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static <K,V> Map<K,V> of(Map<K,V> backingMap, com.google.common.base.Function<K,V> loader)
K
- V
- backingMap
- loader
- public static <K,V> Map<K,V> newAutoMap(Map<K,V> backingMap, Class<? extends K> keyClass, Class<? extends V> valueClass)
K
- Key Type of the MapV
- Value Type of the MapbackingMap
- Actual map being used.keyClass
- Class used for the K genericvalueClass
- Class used for the V genericpublic static <K,V> Map<K,V> newAutoMap(Map<K,V> backingMap, Class<? extends V> valueClass)
K
- Key Type of the MapV
- Value Type of the MapbackingMap
- Actual map being used.valueClass
- Class used for the V genericpublic static <K,V> Map<K,V> newHashAutoMap(Class<? extends K> keyClass, Class<? extends V> valueClass)
K
- V
- keyClass
- valueClass
- new Auto initializing map using a HashMap.
public static <K,V> Map<K,V> newHashAutoMap(Class<? extends V> valueClass)
K
- V
- valueClass
- new Auto initializing map using a HashMap.
public static <K,V> Map<K,V> newHashAutoMap(Class<? extends K> keyClass, Class<? extends V> valueClass, int initialCapacity, float loadFactor)
K
- V
- keyClass
- valueClass
- initialCapacity
- loadFactor
- new Auto initializing map using a HashMap.
public static <K,V> Map<K,V> newHashAutoMap(Class<? extends V> valueClass, int initialCapacity, float loadFactor)
K
- V
- valueClass
- initialCapacity
- loadFactor
- new Auto initializing map using a HashMap.
public static <K,V> Map<K,V> newHashMap(com.google.common.base.Function<K,V> loader)
K
- V
- loader
- public static <K,V> Map<K,V> newHashMap(com.google.common.base.Function<K,V> loader, int initialCapacity, float loadFactor)
K
- V
- loader
- initialCapacity
- loadFactor
- public static <K,V> Map<K,V> newIdentityHashMap(com.google.common.base.Function<K,V> loader)
K
- V
- loader
- public static <K,V> Map<K,V> newIdentityHashMap(com.google.common.base.Function<K,V> loader, int initialCapacity)
K
- V
- loader
- initialCapacity
- public int size()
public boolean isEmpty()
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 void clear()
public Collection<V> values()
public boolean equals(Object o)
public int hashCode()
public LoadingMap<K,V> clone()
clone
in class AbstractMap<K,V>
Copyright © 2022. All rights reserved.