public interface Cache<KEY, VALUE>
Cache
KEY - keyVALUE - value| 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. |
Retrieves a value and updates cache state as needed.
key - the cache keynull if absentRetrieves a value using implementation-specific silent access semantics.
key - the cache keynull if absentStores a value under the supplied key.
key - the cache keyvalue - the cached valueRemoves the value stored for the supplied key.
key - the cache keyReturns the current number of cached entries.