类 LinkedCaseInsensitiveMap<V>
- java.lang.Object
-
- cc.shacocloud.mirage.utils.map.LinkedCaseInsensitiveMap<V>
-
- 所有已实现的接口:
Serializable,Cloneable,Map<String,V>
public class LinkedCaseInsensitiveMap<V> extends Object implements Map<String,V>, Serializable, Cloneable
LinkedHashMap变体,它以不区分大小写的方式存储字符串键,例如,用于结果表中基于键的访问保留原始顺序以及密钥的原始大小写,同时允许包含、获取和删除任何密钥大小写的调用
不支持
null键- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 LinkedCaseInsensitiveMap()创建一个新的 LinkedCaseInsensitive Map,该映射根据默认区域设置(默认为小写)存储不区分大小写的键。LinkedCaseInsensitiveMap(int expectedSize)创建一个新的 LinkedCaseInsensitiveMap,该映射包装具有初始容量的LinkedHashMap, 该容量可以容纳指定数量的元素,而无需立即执行任何预期的 resize/rehash 操作,并根据默认区域设置(小写)存储不区分大小写的键。LinkedCaseInsensitiveMap(int expectedSize, @Nullable Locale locale)创建一个新的 LinkedCaseInsensitiveMap,该映射包装具有初始容量的LinkedHashMap,该容量可以容纳指定数量的元素 ,而无需立即执行任何调整大小重新哈希操作,并根据给定的区域设置(小写)存储不区分大小写的键。LinkedCaseInsensitiveMap(@Nullable Locale locale)创建一个新的 LinkedCaseInsensitive Map,该映射根据给定的区域设置(小写)存储不区分大小写的键。
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclear()LinkedCaseInsensitiveMap<V>clone()VcomputeIfAbsent(String key, @NotNull java.util.function.Function<? super String,? extends V> mappingFunction)booleancontainsKey(Object key)booleancontainsValue(Object value)protected StringconvertKey(@NotNull String key)将给定键转换为不区分大小写的键Set<Map.Entry<String,V>>entrySet()booleanequals(@Nullable Object other)Vget(Object key)LocalegetLocale()返回此LinkedCaseInsensitiveMap使用的区域设置。VgetOrDefault(Object key, V defaultValue)inthashCode()booleanisEmpty()Set<String>keySet()Vput(String key, V value)voidputAll(Map<? extends String,? extends V> map)VputIfAbsent(String key, V value)Vremove(Object key)protected booleanremoveEldestEntry(Map.Entry<String,V> eldest)确定此映射是否应删除给定的最旧条目intsize()StringtoString()Collection<V>values()-
从接口继承的方法 java.util.Map
compute, computeIfPresent, forEach, merge, remove, replace, replace, replaceAll
-
-
-
-
构造器详细资料
-
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap()
创建一个新的 LinkedCaseInsensitive Map,该映射根据默认区域设置(默认为小写)存储不区分大小写的键。- 另请参阅:
convertKey(String)
-
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap(@Nullable @Nullable Locale locale)创建一个新的 LinkedCaseInsensitive Map,该映射根据给定的区域设置(小写)存储不区分大小写的键。- 参数:
locale- 用于不区分大小写的密钥转换的区域设置- 另请参阅:
convertKey(String)
-
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap(int expectedSize)
创建一个新的 LinkedCaseInsensitiveMap,该映射包装具有初始容量的LinkedHashMap, 该容量可以容纳指定数量的元素,而无需立即执行任何预期的 resize/rehash 操作,并根据默认区域设置(小写)存储不区分大小写的键。- 参数:
expectedSize- 预期的元素数(具有要派生的相应容量,因此不需要调整大小重新哈希操作)- 另请参阅:
convertKey(String)
-
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap(int expectedSize, @Nullable @Nullable Locale locale)创建一个新的 LinkedCaseInsensitiveMap,该映射包装具有初始容量的LinkedHashMap,该容量可以容纳指定数量的元素 ,而无需立即执行任何调整大小重新哈希操作,并根据给定的区域设置(小写)存储不区分大小写的键。- 参数:
expectedSize- 预期的元素数(具有要派生的相应容量,因此不需要调整大小重新哈希操作)locale- 用于不区分大小写的密钥转换的区域设置- 另请参阅:
convertKey(String)
-
-
方法详细资料
-
containsKey
public boolean containsKey(Object key)
- 指定者:
containsKey在接口中Map<String,V>
-
containsValue
public boolean containsValue(Object value)
- 指定者:
containsValue在接口中Map<String,V>
-
getOrDefault
@Nullable public V getOrDefault(Object key, V defaultValue)
- 指定者:
getOrDefault在接口中Map<String,V>
-
putIfAbsent
@Nullable public V putIfAbsent(String key, @Nullable V value)
- 指定者:
putIfAbsent在接口中Map<String,V>
-
computeIfAbsent
@Nullable public V computeIfAbsent(String key, @NotNull @NotNull java.util.function.Function<? super String,? extends V> mappingFunction)
- 指定者:
computeIfAbsent在接口中Map<String,V>
-
clone
public LinkedCaseInsensitiveMap<V> clone()
-
equals
public boolean equals(@Nullable @Nullable Object other)
-
getLocale
public Locale getLocale()
返回此LinkedCaseInsensitiveMap使用的区域设置。用于不区分大小写的密钥转换
-
convertKey
protected String convertKey(@NotNull @NotNull String key)
将给定键转换为不区分大小写的键默认实现根据此映射的区域设置将键转换为小写。
- 参数:
key- 用户指定的密钥- 返回:
- 用于存储的密钥
- 另请参阅:
String.toLowerCase(Locale)
-
-