public class

SimpleMapCache

extends Cache<K, V>
java.lang.Object
   ↳ org.apache.lucene.util.cache.Cache<K, V>
     ↳ org.apache.lucene.util.cache.SimpleMapCache<K, V>
Known Direct Subclasses

Class Overview

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

Summary

Fields
protected Map<K, V> map
Public Constructors
SimpleMapCache()
SimpleMapCache(Map<K, V> map)
Public Methods
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.
[Expand]
Inherited Methods
From class org.apache.lucene.util.cache.Cache
From class java.lang.Object
From interface java.io.Closeable

Fields

protected Map<K, V> map

Public Constructors

public SimpleMapCache ()

public SimpleMapCache (Map<K, V> map)

Public Methods

public void close ()

Closes the cache.

public boolean containsKey (Object key)

Returns whether the given key is in this cache.

public V get (Object key)

Returns the value for the given key.

public Set<K> keySet ()

Returns a Set containing all keys in this cache.

public void put (K key, V value)

Puts a (key, value)-pair into the cache.