Package net.sourceforge.rcache

Provides the Cache interface and its main implementations.

See:
          Description

Interface Summary
Cache<K,V> Memory-Sensitive Cache.
KeyedReference<K,V> Reference with an attached key to be used in a cache.
 

Class Summary
BaseCache<K,V> Memory-Sensitive Cache base implementation.
SoftCache<K,V> Memory-Sensitive Cache Based on SoftReferences Entries in a SoftCache can be garbage collected if, and only if, the JVM considers that more memory is needed.
SoftKeyedReference<K,V> KeyedReference implementation based on SoftReference.
WeakCache<K,V> Memory-Sensitive Cache Based on WeakReferences Entries in a WeakCache will be garbage collected as soon as there are no hard references left.
WeakKeyedReference<K,V> KeyedReference implementation based on WeakReference.
 

Enum Summary
Cache.Operation The operations defined in the Cache interface.
 

Package net.sourceforge.rcache Description

Provides the Cache interface and its main implementations.

Package Specification

The picture below shows the UML class diagram of this package:

UML Class diagram of net.sourceforge.rcache
Package UML Class Diagram

Package Usage

The basic usage of this package is fairly simple. If we want an in-memory cache of a certain class Data, keyed with String identifiers, we declare it as:

  Cache<String, Data> cache = new SoftCache<String, Data>();
  ...

Related Documentation



© 2007-2009 Rodrigo Ruiz
This site is hosted by