org.wso2.carbon.governance.api.cache

## Class LRUCache<K,V>

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<K,V>
    - - java.util.LinkedHashMap<K,V>
      - - org.wso2.carbon.governance.api.cache.LRUCache<K,V>

- All Implemented Interfaces:
    Serializable, Cloneable, Map<K,V>

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

  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 maxSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `void` | `exclusiveLock()`
    `V` | `get(Object key)`
    `protected void` | `handleRemovableEntry(Map.Entry<K,V> entry)`
    `V` | `put(K key, V value)`
    `void` | `release()`
    `V` | `remove(Object key)`
    `protected boolean` | `removeEldestEntry(Map.Entry eldest)`

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

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

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

      `clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, 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, putAll, putIfAbsent, remove, replace, replace, size`

- - ### Constructor Detail

    - #### LRUCache

          public LRUCache(int maxSize)

  - ### Method Detail

    - #### get

          public V get(Object key)

      Specified by:
        `get` in interface `Map<K,V>`
      Overrides:
        `get` in class `LinkedHashMap<K,V>`

    - #### put

          public V put(K key,
                       V value)

      Specified by:
        `put` in interface `Map<K,V>`
      Overrides:
        `put` in class `HashMap<K,V>`

    - #### remove

          public V remove(Object key)

      Specified by:
        `remove` in interface `Map<K,V>`
      Overrides:
        `remove` in class `HashMap<K,V>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `Map<K,V>`
      Overrides:
        `clear` in class `LinkedHashMap<K,V>`

    - #### removeEldestEntry

          protected boolean removeEldestEntry(Map.Entry eldest)

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

    - #### handleRemovableEntry

          protected void handleRemovableEntry(Map.Entry<K,V> entry)

    - #### exclusiveLock

          public void exclusiveLock()

    - #### release

          public void release()

Copyright © 2017 WSO2. All Rights Reserved.