Class LazyResettableHashMap<T>
java.lang.Object
org.pushingpixels.substance.internal.utils.LazyResettableHashMap<T>
- Type Parameters:
T- Class for the stored values.
Lazily initialized hash map for caching images. Note that this class is
not thread safe. In Substance, it is used only from EDT.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(HashMapKey key) Checks whether there is a value associated with the specified key.get(HashMapKey key) Returns the value registered for the specified key.getStats()Returns statistical information of the existing hash maps.voidput(HashMapKey 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.
-
Constructor Details
-
LazyResettableHashMap
Creates a new hash map.- Parameters:
displayName- Display name of the new hash map.
-
-
Method Details
-
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
Returns statistical information of the existing hash maps.- Returns:
- Statistical information of the existing hash maps.
-