|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.template.cache.CmsLruCache
This class implements a LRU cache. It uses a Hashtable algorithm with the chaining method for collision handling. The sequence of the Objects is stored in an extra chain. Each object has a pointer to the previous and next object in this chain. If an object is inserted or used it is set to the tail of the chain. If an object has to be remouved it will be the head object. Only works with more than one element.
| Constructor Summary | |
CmsLruCache(int size)
Constructor |
|
| Method Summary | |
void |
clearCache()
Clears the cache completly. |
Vector |
deleteElementsAfterPublish()
Deletes elements after publish. |
Vector |
deleteElementsByClass(String className)
Deletes all elements that depend on the class. |
Vector |
deleteElementsByTemplate(String templateName)
Deletes all elements that depend on the template. |
void |
deleteUri(String uri)
Deletes the uri from the Cache. |
Object |
get(Object key)
returns the value to the key or null if the key is not in the cache. |
Vector |
getAllKeys()
gets all keys in the cache. |
Vector |
getCacheInfo()
Gets the Information of max size and size for the cache. |
Vector |
put(Object key,
Object value)
inserts a new object in the cache. |
void |
remove(Object key)
removes on item from the cache. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CmsLruCache(int size)
size - The size of the cache.| Method Detail |
public Vector put(Object key,
Object value)
key - The key to find the object.value - The object.
public Object get(Object key)
key - The key for the object.
public void remove(Object key)
key - .The key to find the item.public Vector deleteElementsByTemplate(String templateName)
public Vector deleteElementsByClass(String className)
public Vector deleteElementsAfterPublish()
public void deleteUri(String uri)
public void clearCache()
public Vector getCacheInfo()
public Vector getAllKeys()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||