Class CaseInsensitiveDictionaryMap<K,V>
java.lang.Object
java.util.Dictionary<K,V>
org.eclipse.osgi.framework.util.CaseInsensitiveDictionaryMap<K,V>
- All Implemented Interfaces:
Map<K,V>
CaseInsensitiveDictionaryMap classes. This class implements Dictionary and
Map with the following behavior:
- String keys are case-preserved, but the lookup operations are case-insensitive.
- Keys and values must not be null.
- Since:
- 3.13
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty CaseInsensitiveDictionaryMap.CaseInsensitiveDictionaryMap(int initialCapacity) Create an empty CaseInsensitiveDictionaryMap.CaseInsensitiveDictionaryMap(Dictionary<? extends K, ? extends V> dictionary) Create a CaseInsensitiveDictionaryMap dictionary from a Dictionary.CaseInsensitiveDictionaryMap(Map<? extends K, ? extends V> map) Create a CaseInsensitiveDictionaryMap dictionary from a Map. -
Method Summary
Modifier and TypeMethodDescriptionDictionary<K, V> Return an unmodifiable dictionary wrapping this CaseInsensitiveDictionaryMap.Return an unmodifiable map wrapping this CaseInsensitiveDictionaryMap.voidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) elements()entrySet()booleanstatic org.eclipse.osgi.framework.util.CaseInsensitiveDictionaryMap.CaseInsensitiveKeyfindCommonKeyIndex(String key) inthashCode()protected static intinitialCapacity(int size) Compute the initial capacity of a map for the specified number of entries based upon the load factor of 0.75f.booleanisEmpty()keys()keySet()voidintsize()toString()static <K,V> Dictionary <K, V> unmodifiableDictionary(Dictionary<? extends K, ? extends V> d) Return an unmodifiable dictionary wrapping the specified dictionary.values()Methods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
CaseInsensitiveDictionaryMap
public CaseInsensitiveDictionaryMap()Create an empty CaseInsensitiveDictionaryMap. -
CaseInsensitiveDictionaryMap
public CaseInsensitiveDictionaryMap(int initialCapacity) Create an empty CaseInsensitiveDictionaryMap.- Parameters:
initialCapacity- The initial capacity.
-
CaseInsensitiveDictionaryMap
Create a CaseInsensitiveDictionaryMap dictionary from a Dictionary.- Parameters:
dictionary- The initial dictionary for this CaseInsensitiveDictionaryMap object.- Throws:
IllegalArgumentException- If a case-variants of a key are in the dictionary parameter.
-
CaseInsensitiveDictionaryMap
Create a CaseInsensitiveDictionaryMap dictionary from a Map.- Parameters:
map- The initial map for this CaseInsensitiveDictionaryMap object.- Throws:
IllegalArgumentException- If a case-variants of a key are in the map parameter.
-
-
Method Details
-
findCommonKeyIndex
public static org.eclipse.osgi.framework.util.CaseInsensitiveDictionaryMap.CaseInsensitiveKey findCommonKeyIndex(String key) -
initialCapacity
protected static int initialCapacity(int size) Compute the initial capacity of a map for the specified number of entries based upon the load factor of 0.75f.- Parameters:
size- The desired number of entries.- Returns:
- The initial capacity of a map.
-
keys
- Specified by:
keysin classDictionary<K,V>
-
elements
- Specified by:
elementsin classDictionary<K,V>
-
get
-
size
-
isEmpty
-
put
-
remove
-
toString
-
clear
-
containsKey
If the key is a String, the key is located in a case-insensitive manner.
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
entrySet
-
keySet
-
values
-
putAll
-
hashCode
-
equals
-
asUnmodifiableMap
-
asUnmodifiableDictionary
Return an unmodifiable dictionary wrapping this CaseInsensitiveDictionaryMap.- Returns:
- An unmodifiable dictionary wrapping this CaseInsensitiveDictionaryMap.
-
unmodifiableDictionary
Return an unmodifiable dictionary wrapping the specified dictionary.- Returns:
- An unmodifiable dictionary wrapping the specified dictionary.
-