Package org.opencms.cache
Interface I_CmsLruCacheObject
- All Known Implementing Classes:
CmsFlexCacheEntry
public interface I_CmsLruCacheObject
Defines the methods which an object being cached by CmsFlexLruCache must implement.
CmsFlexLruCache is organized as a double linked list, that's why objects implementing this interface need getters/setter for the next/previous nodes in the list of all cached objects.
- Since:
- 6.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked after an object was added to the cache.int
Returns the cache costs of this object, as for example it's byte size.Returns the next object in the double linked list of all cached objects.Returns the previous object in the double linked list of all cached objects.getValue()
Returns the Object value.void
Invoked after the object was removed to the cache.void
setNextLruObject
(I_CmsLruCacheObject theNextObject) Set the next object in the double linked list of all cached objects.void
setPreviousLruObject
(I_CmsLruCacheObject thePreviousObject) Set the previous object in the double linked list of all cached objects.
-
Method Details
-
setNextLruObject
Set the next object in the double linked list of all cached objects.- Parameters:
theNextObject
- the next object
-
getNextLruObject
Returns the next object in the double linked list of all cached objects.- Returns:
- the next object in the double linked list of all cached objects
-
setPreviousLruObject
Set the previous object in the double linked list of all cached objects.- Parameters:
thePreviousObject
- the previous object
-
getPreviousLruObject
Returns the previous object in the double linked list of all cached objects.- Returns:
- the previous object in the double linked list of all cached objects
-
addToLruCache
void addToLruCache()Invoked after an object was added to the cache. -
removeFromLruCache
void removeFromLruCache()Invoked after the object was removed to the cache. -
getLruCacheCosts
int getLruCacheCosts()Returns the cache costs of this object, as for example it's byte size.- Returns:
- the cache costs of this object
-
getValue
Returns the Object value.- Returns:
- the Object value
-