borland Packages Class Hierarchy dbswing Package
java.lang.Object +----com.borland.dbswing.LRUCache
Constructors Properties Methods
Implements Serializable
LRUCache
is used by JdbTable
to cache images stored in Variant.INPUTSTREAM
fields. Don't deploy this class unless your DataSet
contains images and displays them using a dbSwing component.
LRUCache
is a resizable,"least-recently-used" (LRU) general-purpose cache. An LRUCache holds a fixed number of items (25 by default). When the cache is full, adding a new item causes the "oldest" item in the cache to be removed and the new item to become the "newest" item. If an item already in the cache is added to a full cache or if an item is fetched from the cache, that item's "age" is updated so that it becomes the "newest" item in the cache.
public LRUCache()Constructs an
LRUCache
component with space for a maximum of 25 cached items.
public LRUCache(int maxItems)Constructs an
LRUCache
component with space for the specified maximum number of cached items.
maxItems
public int getMaxItems() public void setMaxItems(int newMaxItems)Returns and sets the maximum number of items held in the cache.
public void emptyCache()Empties the cache.
public Object get(Object key)Returns the item in the cache identified by the specified (non-null) key. Returns
null
if the key cannot be found in the cache.
key
public void put(Object key, Object item)Puts an item, retrievable by the specified key, into the cache. Keys and items should not be
null
.
key
item