com.sun.labs.minion.util
Class Cache

java.lang.Object
  extended by com.sun.labs.minion.util.Cache

public abstract class Cache
extends java.lang.Object


Field Summary
protected  int size
          The number of entries to store in the cache.
 
Constructor Summary
Cache(int size)
           
 
Method Summary
abstract  void cache(java.lang.Object key, java.lang.Object value)
          Caches a value under a given key.
abstract  void clear()
          Clears out the cache.
abstract  java.lang.Object get(java.lang.Object key)
          Gets the value corresponding to a given key.
 int getSize()
          Gets the size of the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
The number of entries to store in the cache.

Constructor Detail

Cache

public Cache(int size)
Method Detail

cache

public abstract void cache(java.lang.Object key,
                           java.lang.Object value)
Caches a value under a given key.


get

public abstract java.lang.Object get(java.lang.Object key)
Gets the value corresponding to a given key.

Returns:
the corresponding value, or null if the value is not cached.

clear

public abstract void clear()
Clears out the cache.


getSize

public int getSize()
Gets the size of the cache.