org.apache.ignite.ml.util

## Class LRUCache<K,V>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<K,V>
    - - java.util.LinkedHashMap<K,V>
      - - org.apache.ignite.ml.util.LRUCache<K,V>

- Type Parameters:
    `K` - Type of a key.
    `V` - Type of a value.
  All Implemented Interfaces:
    Serializable, Cloneable, Map<K,V>

      public class LRUCache<K,V>
      extends LinkedHashMap<K,V>

  LRU cache with fixed size and expiration listener.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LRUCache(int cacheSize)` Constructs a new instance of LRU cache.
    `LRUCache(int cacheSize, LRUCacheExpirationListener<V> expirationLsnr)` Constructs a new instance of LRU cache.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `removeEldestEntry(Map.Entry<K,V> eldest)`

    - ### Methods inherited from class java.util.LinkedHashMap

      `clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values`

    - ### Methods inherited from class java.util.HashMap

      `clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size`

    - ### Methods inherited from class java.util.AbstractMap

      `equals, hashCode, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size`

- - ### Constructor Detail

    - #### LRUCache

          public LRUCache(int cacheSize)

      Constructs a new instance of LRU cache.
      Parameters:
        `cacheSize` - Cache size.

    - #### LRUCache

          public LRUCache(int cacheSize,
                          LRUCacheExpirationListener<V> expirationLsnr)

      Constructs a new instance of LRU cache.
      Parameters:
        `cacheSize` - Cache size.
        `expirationLsnr` - Expiration listener.

  - ### Method Detail

    - #### removeEldestEntry

          protected boolean removeEldestEntry(Map.Entry<K,V> eldest)

      Overrides:
        `removeEldestEntry` in class `LinkedHashMap<K,V>`

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020