Package: org.apache.groovy.json.internal

## [Java] Interface Cache<KEY, VALUE>

-     public interface Cache<KEY, VALUE>

  Cache

  Type Parameters:
    `KEY` - key
    `VALUE` - value

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public VALUE` | `get(KEY key)` Retrieves a value and updates cache state as needed.
    `` | `public VALUE` | `getSilent(KEY key)` Retrieves a value using implementation-specific silent access semantics.
    `` | `public void` | `put(KEY key, VALUE value)` Stores a value under the supplied key.
    `` | `public void` | `remove(KEY key)` Removes the value stored for the supplied key.
    `` | `public int` | `size()` Returns the current number of cached entries.

- - ### Method Detail

    - #### public VALUE get(KEY key)

      Retrieves a value and updates cache state as needed.

      Parameters:
        `key` - the cache key
      Returns:
        the cached value, or `null` if absent

    - #### public VALUE getSilent(KEY key)

      Retrieves a value using implementation-specific silent access semantics.

      Parameters:
        `key` - the cache key
      Returns:
        the cached value, or `null` if absent

    - #### public void put(KEY key, VALUE value)

      Stores a value under the supplied key.

      Parameters:
        `key` - the cache key
        `value` - the cached value

    - #### public void remove(KEY key)

      Removes the value stored for the supplied key.

      Parameters:
        `key` - the cache key

    - #### public int size()

      Returns the current number of cached entries.

      Returns:
        the cache size