K
- KeyV
- ValueMap<K,V>
public class LoadingMap<K,V> extends 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
|
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
Constructor | Description |
---|---|
LoadingMap(@NotNull Map<K,V> backingMap,
Function<K,V> loader) |
Initializes an auto loading map using specified loader and backing map
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
|
@NotNull LoadingMap<K,V> |
clone() |
|
boolean |
containsKey(@Nullable Object key) |
|
boolean |
containsValue(@Nullable Object value) |
|
@NotNull Set<Map.Entry<K,V>> |
entrySet() |
|
boolean |
equals(@Nullable Object o) |
|
V |
get(@Nullable Object key) |
|
int |
hashCode() |
|
boolean |
isEmpty() |
|
@NotNull Set<K> |
keySet() |
|
static <K,V> @NotNull Map<K,V> |
newAutoMap(@NotNull Map<K,V> backingMap,
@NotNull Class<? extends V> valueClass) |
Creates a LoadingMap with an auto instantiating loader.
|
static <K,V> @NotNull Map<K,V> |
newAutoMap(@NotNull Map<K,V> backingMap,
@Nullable Class<? extends K> keyClass,
@NotNull Class<? extends V> valueClass) |
Creates a LoadingMap with an auto instantiating loader.
|
static <K,V> @NotNull Map<K,V> |
newHashAutoMap(@NotNull Class<? extends V> valueClass) |
|
static <K,V> @NotNull Map<K,V> |
newHashAutoMap(@NotNull Class<? extends V> valueClass,
int initialCapacity,
float loadFactor) |
|
static <K,V> @NotNull Map<K,V> |
newHashAutoMap(@Nullable Class<? extends K> keyClass,
@NotNull Class<? extends V> valueClass) |
|
static <K,V> @NotNull Map<K,V> |
newHashAutoMap(@Nullable Class<? extends K> keyClass,
@NotNull Class<? extends V> valueClass,
int initialCapacity,
float loadFactor) |
|
static <K,V> @NotNull Map<K,V> |
newHashMap(@NotNull Function<K,V> loader) |
Initializes an auto loading map using a HashMap
|
static <K,V> @NotNull Map<K,V> |
newHashMap(@NotNull Function<K,V> loader,
int initialCapacity) |
Initializes an auto loading map using a HashMap
|
static <K,V> @NotNull Map<K,V> |
newHashMap(@NotNull Function<K,V> loader,
int initialCapacity,
float loadFactor) |
Initializes an auto loading map using a HashMap
|
static <K,V> @NotNull Map<K,V> |
newIdentityHashMap(@NotNull Function<K,V> loader) |
Initializes an auto loading map using an Identity HashMap
|
static <K,V> @NotNull Map<K,V> |
newIdentityHashMap(@NotNull Function<K,V> loader,
int initialCapacity) |
Initializes an auto loading map using an Identity HashMap
|
static <K,V> @NotNull Map<K,V> |
of(@NotNull Map<K,V> backingMap,
@NotNull Function<K,V> loader) |
Creates a new LoadingMap with the specified map and loader
|
V |
put(K key,
V value) |
|
void |
putAll(@NotNull Map<? extends K,? extends V> m) |
|
V |
remove(@Nullable Object key) |
|
int |
size() |
|
@NotNull Collection<V> |
values() |
toString
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
@NotNull public static <K,V> @NotNull Map<K,V> of(@NotNull @NotNull Map<K,V> backingMap, @NotNull @NotNull Function<K,V> loader)
K
- Key Type of the MapV
- Value Type of the MapbackingMap
- Actual map being used.loader
- Loader to use@NotNull public static <K,V> @NotNull Map<K,V> newAutoMap(@NotNull @NotNull Map<K,V> backingMap, @Nullable @Nullable Class<? extends K> keyClass, @NotNull @NotNull 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 generic@NotNull public static <K,V> @NotNull Map<K,V> newAutoMap(@NotNull @NotNull Map<K,V> backingMap, @NotNull @NotNull 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 generic@NotNull public static <K,V> @NotNull Map<K,V> newHashAutoMap(@Nullable @Nullable Class<? extends K> keyClass, @NotNull @NotNull 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.
@NotNull public static <K,V> @NotNull Map<K,V> newHashAutoMap(@NotNull @NotNull 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.
@NotNull public static <K,V> @NotNull Map<K,V> newHashAutoMap(@Nullable @Nullable Class<? extends K> keyClass, @NotNull @NotNull 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.
@NotNull public static <K,V> @NotNull Map<K,V> newHashAutoMap(@NotNull @NotNull 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.
@NotNull public static <K,V> @NotNull Map<K,V> newHashMap(@NotNull @NotNull Function<K,V> loader)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to use@NotNull public static <K,V> @NotNull Map<K,V> newHashMap(@NotNull @NotNull Function<K,V> loader, int initialCapacity)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to useinitialCapacity
- Initial capacity to use@NotNull public static <K,V> @NotNull Map<K,V> newHashMap(@NotNull @NotNull 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 use@NotNull public static <K,V> @NotNull Map<K,V> newIdentityHashMap(@NotNull @NotNull Function<K,V> loader)
K
- Key Type of the MapV
- Value Type of the Maploader
- Loader to use@NotNull public static <K,V> @NotNull Map<K,V> newIdentityHashMap(@NotNull @NotNull 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(@Nullable @Nullable Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public boolean containsValue(@Nullable @Nullable Object value)
containsValue
in interface Map<K,V>
containsValue
in class AbstractMap<K,V>
public void clear()
@NotNull public @NotNull Collection<V> values()
public boolean equals(@Nullable @Nullable Object o)
public int hashCode()
@NotNull public @NotNull LoadingMap<K,V> clone()
clone
in class AbstractMap<K,V>
Copyright © 2020. All rights reserved.