- Type Parameters:
V
- Value
- All Implemented Interfaces:
- 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:
- Serialized Form