Package co.aikar.util
Class LoadingIntMap<V>
java.lang.Object
it.unimi.dsi.fastutil.ints.AbstractInt2ObjectFunction<V>
it.unimi.dsi.fastutil.ints.AbstractInt2ObjectMap<V>
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<V>
co.aikar.util.LoadingIntMap<V>
- Type Parameters:
V- Value
- All Implemented Interfaces:
it.unimi.dsi.fastutil.Function<Integer,,V> it.unimi.dsi.fastutil.Hash,it.unimi.dsi.fastutil.ints.Int2ObjectFunction<V>,it.unimi.dsi.fastutil.ints.Int2ObjectMap<V>,Serializable,Cloneable,Function<Integer,,V> IntFunction<V>,Map<Integer,V>
public class LoadingIntMap<V>
extends it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<V>
Allows you to pass a Loader function that when a key is accessed that doesn't exist,
automatically loads the entry into the map by calling the loader Function.
.get() Will only return null if the Loader can return null.
You may pass any backing Map to use.
This class is not thread safe and should be wrapped with Collections.synchronizedMap on the OUTSIDE of the LoadingMap if needed.
Do not wrap the backing map with Collections.synchronizedMap.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDue to java stuff, you will need to cast it to (Function) for some casesNested classes/interfaces inherited from class it.unimi.dsi.fastutil.ints.AbstractInt2ObjectMap
it.unimi.dsi.fastutil.ints.AbstractInt2ObjectMap.BasicEntry<V extends Object>, it.unimi.dsi.fastutil.ints.AbstractInt2ObjectMap.BasicEntrySet<V extends Object>Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.Hash
it.unimi.dsi.fastutil.Hash.Strategy<K extends Object> -
Field Summary
Fields inherited from class it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
containsNullKey, entries, f, key, keys, mask, maxFill, minN, n, size, value, valuesFields inherited from class it.unimi.dsi.fastutil.ints.AbstractInt2ObjectFunction
defRetValueFields inherited from interface it.unimi.dsi.fastutil.Hash
DEFAULT_GROWTH_FACTOR, DEFAULT_INITIAL_SIZE, DEFAULT_LOAD_FACTOR, FAST_LOAD_FACTOR, FREE, OCCUPIED, PRIMES, REMOVED, VERY_FAST_LOAD_FACTOR -
Constructor Summary
ConstructorsConstructorDescriptionLoadingIntMap(int expectedSize, float loadFactor, @NotNull Function<Integer, V> loader) LoadingIntMap(int expectedSize, @NotNull Function<Integer, V> loader) LoadingIntMap(@NotNull Function<Integer, V> loader) -
Method Summary
Methods inherited from class it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
clear, clone, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, containsKey, containsValue, getOrDefault, hashCode, int2ObjectEntrySet, isEmpty, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, shiftKeys, size, trim, trim, valuesMethods inherited from class it.unimi.dsi.fastutil.ints.AbstractInt2ObjectMap
equals, toStringMethods inherited from class it.unimi.dsi.fastutil.ints.AbstractInt2ObjectFunction
defaultReturnValue, defaultReturnValueMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface it.unimi.dsi.fastutil.Function
applyMethods inherited from interface it.unimi.dsi.fastutil.ints.Int2ObjectFunction
andThenByte, andThenChar, andThenDouble, andThenFloat, andThenInt, andThenLong, andThenObject, andThenReference, andThenShort, apply, compose, composeByte, composeChar, composeDouble, composeFloat, composeInt, composeLong, composeObject, composeReference, composeShortMethods inherited from interface it.unimi.dsi.fastutil.ints.Int2ObjectMap
computeIfAbsentPartial, containsKey, defaultReturnValue, defaultReturnValue, entrySet, forEach, get, getOrDefault, put, removeMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, merge, putIfAbsent, remove, replace, replace, replaceAll