Package: org.codehaus.groovy.runtime.memoize

## [Java] Class LRUCacheK, V

- org.codehaus.groovy.runtime.memoize.LRUCache

- All Implemented Interfaces and Traits:
    MemoizeCache

      @com.github.javaparser.ast.expr.MarkerAnnotationExprThreadSafe
      public final class LRUCache
      extends Object

  A cache backed by a ConcurrentLinkedHashMap

- - ### Constructor Summary

    Constructors
    Constructor and description
    `LRUCache (int maxCacheSize)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `cleanUpNullReferences()` Remove all entries holding SoftReferences to gc-evicted objects.
    `` | `V` | `get(K key)`
    `` | `V` | `getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider)` Try to get the value from cache.
    `` | `V` | `put(K key, V value)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### public LRUCache(int maxCacheSize)

  - ### Method Detail

    - #### public void cleanUpNullReferences()

      Remove all entries holding SoftReferences to gc-evicted objects.

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public V get(K key)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public V getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider)

      Try to get the value from cache. If not found, create the value by MemoizeCache.ValueProvider and put it into the cache, at last return the value. The operation is completed atomically.

      Parameters:
        key
        `valueProvider` - provide the value if the associated value not found

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public V put(K key, V value)