Package org.eclnt.util.map
Class LazyLoadingMap<VALUECLASS>
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
VALUECLASS>
Normal HashMap in which the
This class is extending
get(Object)
method is extended: if
the Map does not yet contain a value with the corresponding key, then
an interface is called to load the value.
This class is extending
HashMap
- so it is NOT thread safe!- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorDescriptionIf using this constructor then you MUST pass call the methodsetLoader(ILazyLoader)
before using the instance. -
Method Summary
Modifier and TypeMethodDescriptiongetDirectly
(Object key) Get against map which calls the "original" get of the map-processing.protected VALUECLASS
void
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
LazyLoadingMap
public LazyLoadingMap()If using this constructor then you MUST pass call the methodsetLoader(ILazyLoader)
before using the instance. -
LazyLoadingMap
-
-
Method Details
-
setLoader
-
getLoader
-
get
- Specified by:
get
in interfaceMap<String,
VALUECLASS> - Overrides:
get
in classHashMap<String,
VALUECLASS>
-
getDirectly
Get against map which calls the "original" get of the map-processing. This means: no lazy-loading. -
lazyLoad
-