Constructor and Description |
---|
LRUCache(int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
long |
getCapacity()
Returns the maximum number of elements the cache can hold.
|
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key) |
void |
setCapacity(long capacity)
Sets the maximum number of elements the cache can hold.
|
int |
size() |
java.util.Collection<V> |
values() |
public LRUCache(int capacity)
capacity
- the maximum number of elements that can be contained in the cache.public void setCapacity(long capacity)
Cache
setCapacity
in interface Cache<K,V>
capacity
- capacitypublic long getCapacity()
Cache
getCapacity
in interface Cache<K,V>
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)