Package com.formdev.flatlaf.util
Class SoftCache<K,V>
- java.lang.Object
-
- com.formdev.flatlaf.util.SoftCache<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
public class SoftCache<K,V> extends java.lang.Object implements java.util.Map<K,V>A simple cache (map) that uses soft references for the values.- Since:
- 2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSoftCache.CacheReference<K,V>
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)Not supported.java.util.Set<java.util.Map.Entry<K,V>>entrySet()Not supported.private voidexpungeStaleEntries()voidforEach(java.util.function.BiConsumer<? super K,? super V> action)Not supported.Vget(java.lang.Object key)private VgetRef(SoftCache.CacheReference<K,V> ref)booleanisEmpty()java.util.Set<K>keySet()Vput(K key, V value)voidputAll(java.util.Map<? extends K,? extends V> m)Vremove(java.lang.Object key)voidreplaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)Not supported.intsize()java.util.Collection<V>values()Not supported.
-
-
-
Field Detail
-
map
private final java.util.Map<K,SoftCache.CacheReference<K,V>> map
-
queue
private final java.lang.ref.ReferenceQueue<V> queue
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
Not supported. ThrowsUnsupportedOperationException.
-
getRef
private V getRef(SoftCache.CacheReference<K,V> ref)
-
values
public java.util.Collection<V> values()
Not supported. ThrowsUnsupportedOperationException.
-
entrySet
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Not supported. ThrowsUnsupportedOperationException.
-
forEach
public void forEach(java.util.function.BiConsumer<? super K,? super V> action)
Not supported. ThrowsUnsupportedOperationException.
-
replaceAll
public void replaceAll(java.util.function.BiFunction<? super K,? super V,? extends V> function)
Not supported. ThrowsUnsupportedOperationException.
-
expungeStaleEntries
private void expungeStaleEntries()
-
-