public class UnOrderedCache implements Cache(Code)
Unordered cache is a hash map backed class. As such, access to individual items
is relatively quick. However getting all the items in cache is a very slow process,
and the order of the items is not guaranteed.
If the size of the unordered cache is specified, then the cache automatically uses
the least recently used (LRU) algorithm to determine which items should be removed
from the cache.
Unless you need to specifically store arrays of objects then this will be the cache
to use for most of your needs.
Creation date: (9/7/00 11:47:14 AM)
Retrieve the cache entry specified by the item key
Parameters: itemKey - the key for the cache entry the resulting cache entry or null if it no longer exists.
Goes through all the new items and adds them to the list.
Parameters: newItems - A java.util.Vector of new items to add tothe cache list throws: CacheException - if there's an error adding the cache entry items
setMaxSize
public synchronized void setMaxSize(int newMaxSize)(Code)
Sets the maximum size for the cache. If it is greater than zero then
we use an LRU Map instead of a normal hashmap to provide automatic
removal of old items.
Parameters: newMaxSize - The new maximum size to use for the cache
setName
public synchronized void setName(String newName)(Code)
Sets the name of the cache
Parameters: newName - the new name to set for the cache.