Package org.zkoss.util
Class EmptyCacheMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.zkoss.util.EmptyCacheMap<K,V>
-
-
Field Summary
-
Fields inherited from interface org.zkoss.util.Cache
DEFAULT_LIFETIME, DEFAULT_MAX_SIZE
-
-
Constructor Summary
Constructors Constructor Description EmptyCacheMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.util.Map.Entry<K,V>>entrySet()intgetLifetime()Returns the minimal lifetime, unit=milliseconds.intgetMaxSize()Returns the maximal allowed size.Vput(K key, V value)Stores an object to the cache.voidsetLifetime(int lifetime)Sets the minimal lifetime.voidsetMaxSize(int maxsize)Sets the maximal allowed size.-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.zkoss.util.Cache
clear, containsKey, get, remove
-
-
-
-
Method Detail
-
put
public V put(K key, V value)
Description copied from interface:CacheStores an object to the cache.
-
getLifetime
public int getLifetime()
Description copied from interface:CacheReturns the minimal lifetime, unit=milliseconds. An mapping won't be removed by GC unless the minimal lifetime or the maximal allowed size exceeds.- Specified by:
getLifetimein interfaceCache<K,V>- See Also:
Cache.getMaxSize()
-
setLifetime
public void setLifetime(int lifetime)
Description copied from interface:CacheSets the minimal lifetime. Default:Cache.DEFAULT_LIFETIME.- Specified by:
setLifetimein interfaceCache<K,V>- Parameters:
lifetime- the lifetime, unit=milliseconds; if non-positive, they will be removed immediately.- See Also:
Cache.getLifetime()
-
getMaxSize
public int getMaxSize()
Description copied from interface:CacheReturns the maximal allowed size. Default:Cache.DEFAULT_MAX_SIZE. An mapping won't be removed by GC unless the minimal lifetime or the maximal allowed size exceeds.- Specified by:
getMaxSizein interfaceCache<K,V>- See Also:
Cache.getLifetime()
-
setMaxSize
public void setMaxSize(int maxsize)
Description copied from interface:CacheSets the maximal allowed size.- Specified by:
setMaxSizein interfaceCache<K,V>- See Also:
Cache.getMaxSize()
-
-