public interface Cache<K,V>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CACHE_CAPACITY
The default capacity of an object cache.
|
| 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.
|
static final int DEFAULT_CACHE_CAPACITY
void add(K key, V value)
java.lang.IllegalArgumentException - if the key is null.V get(K key)
java.lang.IllegalArgumentException - if the key is null.void remove(K key)
java.lang.IllegalArgumentException - if the key is null.int capacity()
void clear()
Copyright © 2012. All Rights Reserved.