Class SoftReferenceCache<T>
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.SoftReferenceCache<T>
-
public class SoftReferenceCache<T> extends java.lang.Object
Caches a value with a soft reference.- Since:
- 6.1.0
- Author:
- Clément Fournier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SoftReferenceCache.UnsafeSupplier<T>
Supplier which can throw exceptions.
-
Constructor Summary
Constructors Constructor Description SoftReferenceCache(SoftReferenceCache.UnsafeSupplier<T> supplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
Gets the value of this cache.boolean
hasValue()
-
-
-
Constructor Detail
-
SoftReferenceCache
public SoftReferenceCache(SoftReferenceCache.UnsafeSupplier<T> supplier)
-
-
Method Detail
-
hasValue
public boolean hasValue()
-
get
public T get()
Gets the value of this cache. Uses the supplier function in cache of cache miss.- Returns:
- The value
-
-