类 MapCache<Key,Value,Param>
java.lang.Object
cn.taketoday.util.MapCache<Key,Value,Param>
- 类型参数:
Key- key typeParam- param type, extra computing param typeValue- value type
Map cache
- 从以下版本开始:
- 3.0
- 作者:
- TODAY 2021/1/27 23:02
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidclear()protected ValuecreateValue(Key key, Param param) final ValueIf the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.final ValueIf the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.final ValueIf the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.
-
字段详细资料
-
mapping
-
mappingFunction
default mapping function
-
-
构造器详细资料
-
MapCache
public MapCache() -
MapCache
public MapCache(int initialCapacity) -
MapCache
- 参数:
mapping- allows to define your own map implementation
-
MapCache
-
MapCache
- 参数:
mapping- allows to define your own map implementation
-
-
方法详细资料
-
get
If the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.High performance way
- 参数:
key- key with which the specified value is to be associatedparam- createValue's param- 返回:
- the current (existing or computed) value associated with the specified key, or null if the computed value is null
- 另请参阅:
-
get
If the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.- 参数:
key- key with which the specified value is to be associated- 返回:
- the current (existing or computed) value associated with the specified key, or null if the computed value is null
-
get
If the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.- 参数:
key- key with which the specified value is to be associatedmappingFunction- the function to compute a value, can be null, if its null use default mappingFunction- 返回:
- the current (existing or computed) value associated with the specified key, or null if the computed value is null
-
createValue
-
put
-
clear
public void clear() -
remove
-