Package com.formdev.flatlaf.util
Class SoftCache<K,V>
java.lang.Object
com.formdev.flatlaf.util.SoftCache<K,V>
- All Implemented Interfaces:
Map<K,V>
A simple cache (map) that uses soft references for the values.
- Since:
- 2
- Author:
- Karl Tauber
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) Not supported.entrySet()Not supported.voidforEach(BiConsumer<? super K, ? super V> action) Not supported.booleanisEmpty()keySet()voidvoidreplaceAll(BiFunction<? super K, ? super V, ? extends V> function) Not supported.intsize()values()Not supported.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace
-
Constructor Details
-
SoftCache
public SoftCache() -
SoftCache
public SoftCache(int initialCapacity)
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
Not supported. ThrowsUnsupportedOperationException.- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
Not supported. ThrowsUnsupportedOperationException. -
entrySet
Not supported. ThrowsUnsupportedOperationException. -
forEach
Not supported. ThrowsUnsupportedOperationException. -
replaceAll
Not supported. ThrowsUnsupportedOperationException.- Specified by:
replaceAllin interfaceMap<K,V>
-