|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.util.FlatCache<K,V>
public class FlatCache<K,V>
Fixed length cache with a LRU replacement policy. If cache items implement CacheListener, they will be informed when they're removed from the cache.
Null keys are not allowed. LruCache is synchronized.
| Constructor Summary | |
|---|---|
FlatCache(int initialCapacity)
|
|
| Method Summary | |
|---|---|
void |
clear()
Clears the cache |
java.lang.Object |
get(K key)
Get an item from the cache and make it most recently used. |
V |
put(K key,
V value)
Puts a new item in the cache. |
V |
remove(K key)
Removes an item from the cache |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FlatCache(int initialCapacity)
| Method Detail |
|---|
public void clear()
public java.lang.Object get(K key)
key - key to lookup the item
public V put(K key,
V value)
key - key to store datavalue - value to be stored
public V remove(K key)
key - the key to remove
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||