| Modifier and Type | Field and Description |
|---|---|
static int |
MIN_CACHE_CAPACITY
The minimum capacity of a cache.
|
DEFAULT_CACHE_CAPACITY| Constructor and Description |
|---|
SimpleCache() |
SimpleCache(int capacity) |
SimpleCache(int capacity,
Cloner<V> cloner) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(K key,
V value)
Add a key-value-pair to the cache.
|
int |
capacity() |
void |
clear()
Remove all elements from the cache.
|
V |
get(K key)
Query a value from the cache by its key.
|
void |
remove(K key)
Remove a key-value-pair from the cache.
|
public static final int MIN_CACHE_CAPACITY
public void add(K key, V value)
Cachepublic V get(K key)
Cachepublic void remove(K key)
Cachepublic int capacity()
Copyright © 2012. All Rights Reserved.