public class LRUCache<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
Constructor and Description |
---|
LRUCache()
Create a new LRUCache with default ratio of 10% fixed elements (level 2).
|
LRUCache(double ratio)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the cache.
|
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)
retrieves the object by key, if it is still in the cache.
|
boolean |
isEmpty() |
java.util.HashSet<K> |
keySet()
Provides a snapshot of keys used in the cache.
|
V |
put(K key,
V o)
Put an object into this cache.
|
void |
putAll(java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key)
Method remove.
|
static void |
shutDown() |
int |
size()
Return the current count of hard and soft references.
|
java.lang.String |
toString()
Return some information about the current LRUCache object.
|
java.util.Collection<V> |
values() |
public LRUCache()
@Deprecated public LRUCache(double ratio)
ratio
- a percent value 0.01 <= ratio <= 0.99public int size()
public V put(K key, V o)
public V get(java.lang.Object key)
public V remove(java.lang.Object key)
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
public java.util.HashSet<K> keySet()
public java.lang.String toString()
toString
in class java.lang.Object
public static void shutDown()