LruCache
A fixed-capacity cache that evicts the least recently used entry first.
get, getOrPut on a hit, and put mark the entry most recently used; containsKey, keys, and toMap do not affect recency. When put inserts a new key while the cache already holds maxSize entries, the least recently used entry is evicted before the insert. All operations run in amortized constant time. Backed by LinkedHashMap.
This class is not thread-safe.
Type Parameters
K
the key type.
V
the value type.
Throws
if maxSize is not positive.