When an element is added when at capacity, the least recently used element will be removed. This callback can be set to be notified with the element being evicted, which may be used for disposal.
An element is about to be removed. Should return true if the element may be evicted, otherwise false. If false is returned for all elements, an IllegalStateError is thrown.
the number of elements in the Map.
Clears all elements from the cache.
true if an element in the Map existed and has been removed, or false if the element does not exist.
boolean indicating whether an element with the specified key exists or not.
Returns an iterable of keys in the map. This will be ordered from least recently used to most.
Returns an iterable of values in the map. This will be ordered from least recently used to most.
An LRU Cache implementation. An LRU (Least Recently Used) Cache is a Map with a fixed capacity. When the capacity is exceeded, the least recently used element will be removed. An element is considered to be used when it has been retrieved via
get, or when it's beenset. Iteration does not affect ordering.