Class LazyResettableHashMap<T>
java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.LazyResettableHashMap<T>
- Type Parameters:
T- Class for the stored values.
Lazily initialized hash map for caching images.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static List<LazyResettableHashMap<?>> List of all existing maps.private Map<LazyResettableHashMap.Key, T> The delegate cache.private StringDisplay name of this hash map. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether there is a value associated with the specified key.private voidCreates the delegate cache if necessary.Returns the value registered for the specified key.getStats()Returns statistical information of the existing hash maps.voidput(LazyResettableHashMap.Key key, T entry) Puts a new key-value pair in the map.static voidreset()Resets all existing hash maps.intsize()Returns the number of key-value pairs of this hash map.
-
Field Details
-
all
List of all existing maps. -
cache
The delegate cache. -
displayName
Display name of this hash map. Is used for tracking the statistics.
-
-
Constructor Details
-
LazyResettableHashMap
Creates a new hash map.- Parameters:
displayName- Display name of the new hash map.
-
-
Method Details
-
createIfNecessary
private void createIfNecessary()Creates the delegate cache if necessary. -
put
Puts a new key-value pair in the map.- Parameters:
key- Pair key.entry- Pair value.
-
get
Returns the value registered for the specified key.- Parameters:
key- Key.- Returns:
- Registered value or
nullif none.
-
containsKey
Checks whether there is a value associated with the specified key.- Parameters:
key- Key.- Returns:
trueif there is an associated value,falseotherwise.
-
size
public int size()Returns the number of key-value pairs of this hash map.- Returns:
- The number of key-value pairs of this hash map.
-
reset
public static void reset()Resets all existing hash maps. -
getStats
-