org.apache.lucene.util.cache
Class SimpleMapCache

java.lang.Object
  extended by org.apache.lucene.util.cache.Cache
      extended by org.apache.lucene.util.cache.SimpleMapCache
Direct Known Subclasses:
SimpleLRUCache

public class SimpleMapCache
extends Cache

Simple cache implementation that uses a HashMap to store (key, value) pairs. This cache is not synchronized, use Cache.synchronizedCache(Cache) if needed.


Constructor Summary
SimpleMapCache()
           
SimpleMapCache(Map map)
           
 
Method Summary
 void close()
          Closes the cache.
 boolean containsKey(Object key)
          Returns whether the given key is in this cache.
 Object get(Object key)
          Returns the value for the given key.
 Set keySet()
          Returns a Set containing all keys in this cache.
 void put(Object key, Object 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
 

Constructor Detail

SimpleMapCache

public SimpleMapCache()

SimpleMapCache

public SimpleMapCache(Map map)
Method Detail

get

public Object get(Object key)
Description copied from class: Cache
Returns the value for the given key.

Specified by:
get in class Cache

put

public void put(Object key,
                Object value)
Description copied from class: Cache
Puts a (key, value)-pair into the cache.

Specified by:
put in class Cache

close

public void close()
Description copied from class: Cache
Closes the cache.

Specified by:
close in class Cache

containsKey

public boolean containsKey(Object key)
Description copied from class: Cache
Returns whether the given key is in this cache.

Specified by:
containsKey in class Cache

keySet

public Set keySet()
Returns a Set containing all keys in this cache.



Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.