|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A cache is a list of Cacheable objects that can be stored in memory, cleared, added to and removed from. It also stores information about how many times it has been used. This interface defines how a generic cache object should behave, but the specifics are up to the implementor.
Implementation Note: The implementation of ordered or unordered caches should be such that getItems() or getItem() will NEVER return an expired cache item. Implementations should check isExpired() before adding the cache item to the return list.
| Method Summary | |
void |
addItem(CacheEntry newItem)
Add a new item to the cache. |
void |
clear()
Clear all items from the cache |
CacheEntry |
getCacheEntry(String itemKey)
Retrieve the low-level CacheEntry for the cache. |
Cacheable |
getItem(String itemKey)
Get the item indicated by the given key from the cache. |
int |
getItemCount()
Retrieve Cache Item Count |
Vector |
getItems()
Get all the items in the cache |
String |
getName()
Get the name of the cache |
long |
getUsedCount()
Get how many times this cache has been used |
boolean |
isOrdered()
Retrieve whether the cache instance is an ordered cache [list based] or unordered cache. |
void |
removeItem(Cacheable itemKey)
Removes the specified item from the cache. |
void |
setItems(List newItems)
Eventually the new way to set items |
void |
setItems(Vector newItems)
Set the items in the cache |
void |
setMaxSize(int newMax)
Sets the maximum size of the cache |
void |
setName(String newName)
Sets the name of the cache |
| Method Detail |
public void addItem(CacheEntry newItem)
newItem - the new item to add to the cachepublic void clear()
public CacheEntry getCacheEntry(String itemKey)
itemKey - the key for the entry
public Cacheable getItem(String itemKey)
itemKey - the key of the item to retrieve
public boolean isOrdered()
public int getItemCount()
public Vector getItems()
public String getName()
public long getUsedCount()
public void removeItem(Cacheable itemKey)
itemKey - The item in the cache to remove
public void setItems(Vector newItems)
throws CacheException
newItems - The vector of new items
CacheException - If there's an error setting the new items in
the cache
public void setItems(List newItems)
throws CacheException
newItems - the new items to add
CacheException - upon errorpublic void setMaxSize(int newMax)
newMax - The new maximum size of the cache.public void setName(String newName)
newName - java.lang.String The new name of the cache.
|
Expresso 5-5-0 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||