public abstract class

Cache

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

Class Overview

Base class for cache implementations.

Summary

Public Constructors
Cache()
Public Methods
abstract void close()
Closes the cache.
abstract boolean containsKey(Object key)
Returns whether the given key is in this cache.
abstract V get(Object key)
Returns the value for the given key.
abstract void put(K key, V value)
Puts a (key, value)-pair into the cache.
static <K, V> Cache<K, V> synchronizedCache(Cache<K, V> cache)
Returns a thread-safe cache backed by the specified cache.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public Cache ()

Public Methods

public abstract void close ()

Closes the cache.

public abstract boolean containsKey (Object key)

Returns whether the given key is in this cache.

public abstract V get (Object key)

Returns the value for the given key.

public abstract void put (K key, V value)

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

public static Cache<K, V> synchronizedCache (Cache<K, V> cache)

Returns a thread-safe cache backed by the specified cache. In order to guarantee thread-safety, all access to the backed cache must be accomplished through the returned cache.