LRUCache
LRUCache implements a memory-sensitive least-recently-used cache. All public operations support concurrent access. It avoids redundant simultaneous computation of values by racing threads that present the same keys.
Author
Todd L Smith
Parameters
The type of the keys.
The type of the values.
The capacity of the cache. This is the maximum number of cached values that will ever be retained simultaneously. Must be greater than zero (0).
The maximum number of cached values that will be strongly retained to prevent garbage collection. Must be less than or equal to the capacity.
The function responsible for producing new values from user-supplied keys. Must not produce null.
The action responsible for retiring a binding expired from the cache, or null if no such action should be performed.
Constructors
Types
Functions
Remove the specified key and any value associated with it. If the key is present, and the softly held corresponding value has not been reclaimed by the garbage collector, then perform the retirement action, if any.