## org.apache.lucene.util.cache
Class Cache

    java.lang.Object
      org.apache.lucene.util.cache.Cache

Direct Known Subclasses:
  SimpleMapCache

    public abstract class Cache

extends java.lang.Object

Base class for cache implementations.

Constructor Summary
`Cache()`

Method Summary
`abstract void` `close()` Closes the cache.
`abstract boolean` `containsKey(java.lang.Object key)` Returns whether the given key is in this cache.
`abstract java.lang.Object` `get(java.lang.Object key)` Returns the value for the given key.
`abstract void` `put(java.lang.Object key, java.lang.Object value)` Puts a (key, value)-pair into the cache.
`static Cache` `synchronizedCache(Cache cache)` Returns a thread-safe cache backed by the specified cache.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Cache

    public Cache()

Method Detail

### synchronizedCache

    public static Cache synchronizedCache(Cache 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.

### put

    public abstract void put(java.lang.Object key,
                             java.lang.Object value)

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

### get

    public abstract java.lang.Object get(java.lang.Object key)

  Returns the value for the given key.

### containsKey

    public abstract boolean containsKey(java.lang.Object key)

  Returns whether the given key is in this cache.

### close

    public abstract void close()

  Closes the cache.

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