Package freemarker.cache
Interface CacheStorage
-
- All Known Subinterfaces:
ConcurrentCacheStorage
- All Known Implementing Classes:
MruCacheStorage,SoftCacheStorage,StrongCacheStorage
public interface CacheStorageCache storage abstracts away the storage aspects of a cache - associating an object with a key, retrieval and removal via the key. It is actually a small subset of theMapinterface. The implementations can be coded in a non-threadsafe manner as the natural user of the cache storage,TemplateCachedoes the necessary synchronization.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Removes all values from this cacheObjectget(Object key)Retrieve a cached value associated with a keyvoidput(Object key, Object value)Associates a key with a cached valuevoidremove(Object key)Removes the value associated with a key, if it exists.
-
-
-
Method Detail
-
get
Object get(Object key)
Retrieve a cached value associated with a key- Parameters:
key- the key for retrieving an associated value- Returns:
- the cached value associated with the key, or null if no value is associated with the key.
-
put
void put(Object key, Object value)
Associates a key with a cached value- Parameters:
key- the key to associate with a valuevalue- the value associated with the key.
-
remove
void remove(Object key)
Removes the value associated with a key, if it exists. If it doesn't exist, this method does nothing.- Parameters:
key- the key whose associated value is removed from the cache.
-
clear
void clear()
Removes all values from this cache
-
-