|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.util.cache.Cache<K,V>
org.apache.lucene.util.cache.SimpleMapCache<K,V>
public class SimpleMapCache<K,V>
Simple cache implementation that uses a HashMap to store (key, value) pairs.
This cache is not synchronized, use Cache.synchronizedCache(Cache)
if needed.
| Field Summary | |
|---|---|
protected Map<K,V> |
map
|
| Constructor Summary | |
|---|---|
SimpleMapCache()
|
|
SimpleMapCache(Map<K,V> map)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the cache. |
boolean |
containsKey(Object key)
Returns whether the given key is in this cache. |
V |
get(Object key)
Returns the value for the given key. |
Set<K> |
keySet()
Returns a Set containing all keys in this cache. |
void |
put(K key,
V value)
Puts a (key, value)-pair into the cache. |
| Methods inherited from class org.apache.lucene.util.cache.Cache |
|---|
synchronizedCache |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<K,V> map
| Constructor Detail |
|---|
public SimpleMapCache()
public SimpleMapCache(Map<K,V> map)
| Method Detail |
|---|
public V get(Object key)
Cache
get in class Cache<K,V>
public void put(K key,
V value)
Cache
put in class Cache<K,V>public void close()
Cache
close in interface Closeableclose in class Cache<K,V>public boolean containsKey(Object key)
Cache
containsKey in class Cache<K,V>public Set<K> keySet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||