Package org.thymeleaf.cache
Class StandardCache<K,V>
- Object
-
- org.thymeleaf.cache.StandardCache<K,V>
-
-
Constructor Summary
Constructors Constructor Description StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, org.slf4j.Logger logger)StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger, boolean enableCounters)StandardCache(String name, boolean useSoftReferences, int initialCapacity, org.slf4j.Logger logger)StandardCache(String name, boolean useSoftReferences, int initialCapacity, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the entire cache.voidclearKey(K key)Clears a specific entry in the cache.Vget(K key)Retrieve a value from the cache.Vget(K key, ICacheEntryValidityChecker<? super K,? super V> validityChecker)Retrieve a value from the cache, using the specified validity checker to ensure the entry is still valid.longgetGetCount()longgetHitCount()doublegetHitRatio()intgetMaxSize()longgetMissCount()doublegetMissRatio()StringgetName()longgetPutCount()booleangetUseSoftReferences()booleanhasMaxSize()Set<K>keySet()Returns all the keys contained in this cache.voidput(K key, V value)Insert a new value into the cache.intsize()
-
-
-
Constructor Detail
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger)
-
StandardCache
public StandardCache(String name, boolean useSoftReferences, int initialCapacity, int maxSize, ICacheEntryValidityChecker<? super K,? super V> entryValidityChecker, org.slf4j.Logger logger, boolean enableCounters)
-
-
Method Detail
-
put
public void put(K key, V value)
Description copied from interface:ICacheInsert a new value into the cache.
-
get
public V get(K key, ICacheEntryValidityChecker<? super K,? super V> validityChecker)
Description copied from interface:ICacheRetrieve a value from the cache, using the specified validity checker to ensure the entry is still valid. If the cache already has a default validity checker, this method should override this setting and use the one specified instead.
-
keySet
public Set<K> keySet()
Returns all the keys contained in this cache. Note this method might return keys for entries that are already invalid, so the result of calling
get(Object)for these keys might benull.
-
clear
public void clear()
Description copied from interface:ICacheClear the entire cache.
-
clearKey
public void clearKey(K key)
Description copied from interface:ICacheClears a specific entry in the cache.
-
getName
public String getName()
-
hasMaxSize
public boolean hasMaxSize()
-
getMaxSize
public int getMaxSize()
-
getUseSoftReferences
public boolean getUseSoftReferences()
-
size
public int size()
-
getPutCount
public long getPutCount()
-
getGetCount
public long getGetCount()
-
getHitCount
public long getHitCount()
-
getMissCount
public long getMissCount()
-
getHitRatio
public double getHitRatio()
-
getMissRatio
public double getMissRatio()
-
-