org.apache.lucene.index

## Interface IndexReader.CacheHelper

Enclosing class:
  IndexReader

    public static interface IndexReader.CacheHelper

A utility class that gives hooks in order to help build a cache based on the data that is contained in this index.

WARNING: This API is experimental and might change in incompatible ways in the next release.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addClosedListener(IndexReader.ClosedListener listener)` Add a `IndexReader.ClosedListener` which will be called when the resource guarded by `getKey()` is closed.
`IndexReader.CacheKey` `getKey()` Get a key that the resource can be cached on.

### Method Detail

#### getKey

    IndexReader.CacheKey getKey()

Get a key that the resource can be cached on. The given entry can be compared using identity, ie. `Object.equals(java.lang.Object)` is implemented as `==` and `Object.hashCode()` is implemented as `System.identityHashCode(java.lang.Object)`.

#### addClosedListener

    void addClosedListener(IndexReader.ClosedListener listener)

Add a `IndexReader.ClosedListener` which will be called when the resource guarded by `getKey()` is closed.