Package: org.codehaus.groovy.runtime.memoize

## [Java] Class ConcurrentCommonCacheK, V

- org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache

- All Implemented Interfaces and Traits:
    EvictableCache, ValueConvertable, Serializable

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

  Represents a simple key-value cache, which is thread safe and backed by a Map instance

  Parameters:
    `` - type of the keys
    `` - type of the values
  Since:
    2.5.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ConcurrentCommonCache ()` Constructs a cache with unlimited size
    `ConcurrentCommonCache (int initialCapacity, int maxSize, EvictionStrategy evictionStrategy)` Constructs a cache with limited size
    `ConcurrentCommonCache (int initialCapacity, int maxSize)` Constructs a LRU cache with the specified initial capacity and max size.
    `ConcurrentCommonCache (int maxSize)` Constructs a LRU cache with the default initial capacity(16)
    `ConcurrentCommonCache (Map<K, V> map)` Constructs a cache backed by the specified Map instance

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `cleanUpNullReferences()` {@inheritDoc}
    `` | `Map<K, V>` | `clearAll()` {@inheritDoc}
    `` | `boolean` | `containsKey(Object key)` {@inheritDoc}
    `` | `boolean` | `containsValue(Object value)`
    `` | `Object` | `convertValue(V value)` {@inheritDoc}
    `` | `Set<Entry<K, V>>` | `entrySet()`
    `` | `V` | `get(Object key)` {@inheritDoc}
    `` | `V` | `getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider)` {@inheritDoc}
    `` | `V` | `getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider, boolean shouldCache)`
    `` | `boolean` | `isEmpty()`
    `` | `Set<K>` | `keySet()`
    `` | `Set<K>` | `keys()` {@inheritDoc}
    `` | `V` | `put(K key, V value)` {@inheritDoc}
    `` | `void` | `putAll(Map<? extends K, ? extends V> m)`
    `` | `V` | `remove(Object key)` {@inheritDoc}
    `` | `int` | `size()` {@inheritDoc}
    `` | `Collection<V>` | `values()` {@inheritDoc}

  - ### Inherited Methods Summary

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

- - ### Constructor Detail

    - #### public ConcurrentCommonCache()

      Constructs a cache with unlimited size

    - #### public ConcurrentCommonCache(int initialCapacity, int maxSize, EvictionStrategy evictionStrategy)

      Constructs a cache with limited size

      Parameters:
        `initialCapacity` - initial capacity of the cache
        `maxSize` - max size of the cache
        `evictionStrategy` - LRU or FIFO, see org.codehaus.groovy.runtime.memoize.EvictableCache.EvictionStrategy

    - #### public ConcurrentCommonCache(int initialCapacity, int maxSize)

      Constructs a LRU cache with the specified initial capacity and max size. The LRU cache is slower than LRUCache

      Parameters:
        `initialCapacity` - initial capacity of the LRU cache
        `maxSize` - max size of the LRU cache

    - #### public ConcurrentCommonCache(int maxSize)

      Constructs a LRU cache with the default initial capacity(16)

      Parameters:
        `maxSize` - max size of the LRU cache
      See Also:
        ConcurrentCommonCache(int, int)

    - #### public ConcurrentCommonCache(Map<K, V> map)

      Constructs a cache backed by the specified Map instance

      Parameters:
        `map` - the Map instance

  - ### Method Detail

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void cleanUpNullReferences()

      {@inheritDoc}

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public Map<K, V> clearAll()

      {@inheritDoc}

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public boolean containsKey(Object key)

      {@inheritDoc}

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public boolean containsValue(Object value)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public Object convertValue(V value)

      {@inheritDoc}

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public Set<Entry<K, V>> entrySet()

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

      {@inheritDoc}

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

      {@inheritDoc}

    - #### public V getAndPut(K key, ValueProvider<? super K, ? extends V> valueProvider, boolean shouldCache)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public boolean isEmpty()

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public Set<K> keySet()

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public Set<K> keys()

      {@inheritDoc}

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

      {@inheritDoc}

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public void putAll(Map<? extends K, ? extends V> m)

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public V remove(Object key)

      {@inheritDoc}

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public int size()

      {@inheritDoc}

    - #### @com.github.javaparser.ast.expr.MarkerAnnotationExprOverride public Collection<V> values()

      {@inheritDoc}