Package org.zkoss.util
Class EmptyCacheMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.zkoss.util.EmptyCacheMap<K,V>
An empty cache map.
- Since:
- 9.6.0
- Author:
- jameschu
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields inherited from interface org.zkoss.util.Cache
DEFAULT_LIFETIME, DEFAULT_MAX_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentrySet()intReturns the minimal lifetime, unit=milliseconds.intReturns the maximal allowed size.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, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.zkoss.util.Cache
clear, containsKey, get, removeMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
EmptyCacheMap
public EmptyCacheMap()
-
-
Method Details
-
put
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:
-
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:
-
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:
-
setMaxSize
public void setMaxSize(int maxsize) Description copied from interface:CacheSets the maximal allowed size.- Specified by:
setMaxSizein interfaceCache<K,V> - See Also:
-
entrySet
-