Class IntrusiveSoftLRU<T>
java.lang.Object
com.illumon.util.datastructures.intrusive.IntrusiveSoftLRU<T>
- Type Parameters:
T
- the cached type
- Direct Known Subclasses:
PageCache
public class IntrusiveSoftLRU<T> extends Object
A Caching structure that uses simple arrays with doubling, until a threshold is reached. It then switches to an
LRU cache beyond the maximum size.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
IntrusiveSoftLRU.Adapter<T>
An interface defining the required intrusive property getters and setters.static interface
IntrusiveSoftLRU.Node<T extends IntrusiveSoftLRU.Node<T>>
An intrusive node for storing items in the cache. -
Constructor Summary
Constructors Constructor Description IntrusiveSoftLRU(IntrusiveSoftLRU.Adapter<T> adapter, int initialCapacity, int maxCapacity)
Create a cache object with the specified initial capacity. -
Method Summary
-
Constructor Details
-
IntrusiveSoftLRU
public IntrusiveSoftLRU(@NotNull IntrusiveSoftLRU.Adapter<T> adapter, int initialCapacity, int maxCapacity)Create a cache object with the specified initial capacity. The structure will switch to LRU mode once maxCapacity has been reached.- Parameters:
adapter
- theIntrusiveSoftLRU.Adapter
object for setting the intrusive properties.initialCapacity
- the initial size of the cache.maxCapacity
- the maximum capacity of the cache.
-
-
Method Details