K
- KeyV
- Valuejava.util.Map<K,V>
public class LoadingMap<K,V>
extends java.util.AbstractMap<K,V>
Modifier and Type | Class | Description |
---|---|---|
static class |
LoadingMap.Feeder<T> |
Due to java stuff, you will need to cast it to (Function) for some cases
|
Constructor | Description |
---|---|
LoadingMap(java.util.Map<K,V> backingMap,
java.util.function.Function<K,V> loader) |
Initializes an auto loading map using specified loader and backing map
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
LoadingMap<K,V> |
clone() |
|
boolean |
containsKey(java.lang.Object key) |
|
boolean |
containsValue(java.lang.Object value) |
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
|
boolean |
equals(java.lang.Object o) |
|
V |
get(java.lang.Object key) |
|
int |
hashCode() |
|
boolean |
isEmpty() |
|
java.util.Set<K> |
keySet() |
|
static <K,V> java.util.Map<K,V> |
newAutoMap(java.util.Map<K,V> backingMap,
java.lang.Class<? extends K> keyClass,
java.lang.Class<? extends V> valueClass) |
Creates a LoadingMap with an auto instantiating loader.
|
static <K,V> java.util.Map<K,V> |
newAutoMap(java.util.Map<K,V> backingMap,
java.lang.Class<? extends V> valueClass) |
Creates a LoadingMap with an auto instantiating loader.
|
static <K,V> java.util.Map<K,V> |
newHashAutoMap(java.lang.Class<? extends K> keyClass,
java.lang.Class<? extends V> valueClass) |
|
static <K,V> java.util.Map<K,V> |
newHashAutoMap(java.lang.Class<? extends K> keyClass,
java.lang.Class<? extends V> valueClass,
int initialCapacity,
float loadFactor) |
|
static <K,V> java.util.Map<K,V> |
newHashAutoMap(java.lang.Class<? extends V> valueClass) |
|
static <K,V> java.util.Map<K,V> |
newHashAutoMap(java.lang.Class<? extends V> valueClass,
int initialCapacity,
float loadFactor) |
|
static <K,V> java.util.Map<K,V> |
newHashMap(java.util.function.Function<K,V> loader) |
Initializes an auto loading map using a HashMap
|
static <K,V> java.util.Map<K,V> |
newHashMap(java.util.function.Function<K,V> loader,
int initialCapacity) |
Initializes an auto loading map using a HashMap
|
static <K,V> java.util.Map<K,V> |
newHashMap(java.util.function.Function<K,V> loader,
int initialCapacity,
float loadFactor) |
Initializes an auto loading map using a HashMap
|
static <K,V> java.util.Map<K,V> |
newIdentityHashMap(java.util.function.Function<K,V> loader) |
Initializes an auto loading map using an Identity HashMap
|
static <K,V> java.util.Map<K,V> |
newIdentityHashMap(java.util.function.Function<K,V> loader,
int initialCapacity) |
Initializes an auto loading map using an Identity HashMap
|
static <K,V> java.util.Map<K,V> |
of(java.util.Map<K,V> backingMap,
java.util.function.Function<K,V> loader) |
Creates a new LoadingMap with the specified map and loader
|
V |
put(K key,
V value) |
|
void |
putAll(java.util.Map<? extends K,? extends V> m) |
|
V |
remove(java.lang.Object key) |
|
int |
size() |
|
java.util.Collection<V> |
values() |
public static <K,V> java.util.Map<K,V> of(java.util.Map<K,V> backingMap, java.util.function.Function<K,V> loader)
K
- Key Type of the MapV
- Value Type of the MapbackingMap
- Actual map being used.loader
- Loader to usepublic static <K,V> java.util.Map<K,V> newAutoMap(java.util.Map<K,V> backingMap, java.lang.Class<? extends K> keyClass, java.lang.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> java.util.Map<K,V> newAutoMap(java.util.Map<K,V> backingMap, java.lang.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> java.util.Map<K,V> newHashAutoMap(java.lang.Class<? extends K> keyClass, java.lang.Class<? extends V> valueClass)
K
- Key Type of the MapV
- Value Type of the MapkeyClass
- Class used for the K genericvalueClass
- Class used for the V genericnew Auto initializing map using a HashMap.
public static <K,V> java.util.Map<K,V> newHashAutoMap(java.lang.Class<? extends V> valueClass)
K
- Key Type of the MapV
- Value Type of the MapvalueClass
- Class used for the V genericnew Auto initializing map using a HashMap.
public static <K,V> java.util.Map<K,V> newHashAutoMap(java.lang.Class<? extends K> keyClass, java.lang.Class<? extends V> valueClass, int initialCapacity, float loadFactor)
K
- Key Type of the MapV
- Value Type of the MapkeyClass
- Class used for the K genericvalueClass
- Class used for the V genericinitialCapacity
- Initial capacity to useloadFactor
- Load factor to usenew Auto initializing map using a HashMap.
public static <K,V> java.util.Map<K,V> newHashAutoMap(java.lang.Class<? extends V> valueClass, int initialCapacity, float loadFactor)
K
- Key Type of the MapV
- Value Type of the MapvalueClass
- Class used for the V genericinitialCapacity
- Initial capacity to useloadFactor
- Load factor to usenew Auto initializing map using a HashMap.
public static <K,V> java.util.Map<K,V> newHashMap(java.util.function.Function<K,V> loader)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to usepublic static <K,V> java.util.Map<K,V> newHashMap(java.util.function.Function<K,V> loader, int initialCapacity)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to useinitialCapacity
- Initial capacity to usepublic static <K,V> java.util.Map<K,V> newHashMap(java.util.function.Function<K,V> loader, int initialCapacity, float loadFactor)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to useinitialCapacity
- Initial capacity to useloadFactor
- Load factor to usepublic static <K,V> java.util.Map<K,V> newIdentityHashMap(java.util.function.Function<K,V> loader)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to usepublic static <K,V> java.util.Map<K,V> newIdentityHashMap(java.util.function.Function<K,V> loader, int initialCapacity)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to useinitialCapacity
- Initial capacity to usepublic int size()
public boolean isEmpty()
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public V get(java.lang.Object key)
public V remove(java.lang.Object key)
public void clear()
public java.util.Set<K> keySet()
public java.util.Collection<V> values()
public boolean equals(java.lang.Object o)
public int hashCode()
public LoadingMap<K,V> clone()
Copyright © 2018. All rights reserved.