V - the keyType of elements maintained by this Collectionpublic class Char2ObjectConcurrentOpenHashMap<V> extends AbstractChar2ObjectMap<V> implements Char2ObjectConcurrentMap<V>, ITrimmable
AbstractChar2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Char2ObjectMap.BuilderCache<V>, Char2ObjectMap.Entry<V>, Char2ObjectMap.FastEntrySet<V>, Char2ObjectMap.MapBuilder| Constructor and Description |
|---|
Char2ObjectConcurrentOpenHashMap()
Default Constructor
|
Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values,
float loadFactor,
int concurrencyLevel)
Helper constructor that allow to create a map from unboxed values
|
Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values,
int concurrencyLevel)
Helper constructor that allow to create a map from unboxed values
|
Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map,
float loadFactor,
int concurrencyLevel)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map,
int concurrencyLevel)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values,
float loadFactor,
int concurrencyLevel)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values,
int concurrencyLevel)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2ObjectConcurrentOpenHashMap(float loadFactor,
int concurrencyLevel)
Constructor that defines the load factor and concurrencyLevel
|
Char2ObjectConcurrentOpenHashMap(int minCapacity)
Constructor that defines the minimum capacity
|
Char2ObjectConcurrentOpenHashMap(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
Char2ObjectConcurrentOpenHashMap(int minCapacity,
float loadFactor,
int concurrencyLevel)
Constructor that defines the minimum capacity, load factor and concurrencyLevel
|
Char2ObjectConcurrentOpenHashMap(int minCapacity,
int concurrencyLevel)
Constructor that defines the minimum capacity and concurrencyLevel
|
Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map,
float loadFactor)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map,
float loadFactor,
int concurrencyLevel)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map,
int concurrencyLevel)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectSet<Char2ObjectMap.Entry<V>> |
char2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
V |
compute(char key,
CharObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(char key,
CharFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(char key,
CharObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(char key)
Type Specific method to reduce boxing/unboxing of values
|
Char2ObjectConcurrentOpenHashMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(CharObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(char key)
A Type Specific get method to reduce boxing/unboxing
|
V |
get(java.lang.Object key) |
V |
getOrDefault(char key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
boolean |
isEmpty() |
CharSet |
keySet() |
V |
merge(char key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
V |
put(char key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putIfAbsent(char key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(char key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(char key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
removeOrDefault(char key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
replace(char key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(char key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
V |
supplyIfAbsent(char key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
ObjectCollection<V> |
values() |
containsValue, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, mergeAll, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceObjects, replaceObjects, setDefaultReturnValuecompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, replace, replace, replaceAllapply, builder, containsKey, entrySet, getDefaultReturnValue, mergeAll, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceObjects, replaceObjects, setDefaultReturnValue, synchronize, synchronize, unmodifiableclearAndTrim, trimpublic Char2ObjectConcurrentOpenHashMap()
public Char2ObjectConcurrentOpenHashMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Char2ObjectConcurrentOpenHashMap(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Char2ObjectConcurrentOpenHashMap(int minCapacity,
int concurrencyLevel)
minCapacity - the minimum capacity the HashMap is allowed to be.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(float loadFactor,
int concurrencyLevel)
loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(int minCapacity,
float loadFactor,
int concurrencyLevel)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values,
float loadFactor)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values,
int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(java.lang.Character[] keys,
V[] values,
float loadFactor,
int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values,
float loadFactor)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values,
int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(char[] keys,
V[] values,
float loadFactor,
int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map)
map - the values that should be present in the mappublic Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map, int concurrencyLevel)
map - the values that should be present in the mapconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(java.util.Map<? extends java.lang.Character,? extends V> map, float loadFactor, int concurrencyLevel)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map)
map - the values that should be present in the mappublic Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map, int concurrencyLevel)
map - the values that should be present in the mapconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Char2ObjectConcurrentOpenHashMap(Char2ObjectMap<V> map, float loadFactor, int concurrencyLevel)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public V put(char key, V value)
Char2ObjectMapput in interface Char2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(char key, V value)
Char2ObjectMapputIfAbsent in interface Char2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V remove(char key)
Char2ObjectMapremove in interface Char2ObjectMap<V>key - the element that should be removedpublic boolean remove(char key,
V value)
Char2ObjectMapremove in interface Char2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.concurrent.ConcurrentMap<java.lang.Character,V>remove in interface java.util.Map<java.lang.Character,V>remove in interface Char2ObjectConcurrentMap<V>remove in interface Char2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public V removeOrDefault(char key, V defaultValue)
Char2ObjectMapremoveOrDefault in interface Char2ObjectMap<V>key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public V get(char key)
Char2ObjectMapget in interface Char2ObjectMap<V>key - the key that is searched forpublic V get(java.lang.Object key)
get in interface java.util.Map<java.lang.Character,V>get in interface Char2ObjectMap<V>get in class AbstractChar2ObjectMap<V>public V getOrDefault(char key, V defaultValue)
Char2ObjectMapgetOrDefault in interface Char2ObjectMap<V>getOrDefault in class AbstractChar2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic void forEach(CharObjectConsumer<V> action)
Char2ObjectMapforEach in interface Char2ObjectMap<V>forEach in class AbstractChar2ObjectMap<V>action - processor of the values that are iterator overpublic Char2ObjectConcurrentOpenHashMap<V> copy()
Char2ObjectMapcopy in interface Char2ObjectMap<V>copy in class AbstractChar2ObjectMap<V>public boolean containsKey(char key)
Char2ObjectMapcontainsKey in interface Char2ObjectMap<V>containsKey in class AbstractChar2ObjectMap<V>key - element that is searched forpublic boolean replace(char key,
V oldValue,
V newValue)
Char2ObjectMapreplace in interface Char2ObjectMap<V>replace in class AbstractChar2ObjectMap<V>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public V replace(char key, V value)
Char2ObjectMapreplace in interface Char2ObjectMap<V>replace in class AbstractChar2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(char key, CharObjectUnaryOperator<V> mappingFunction)
Char2ObjectMapcompute in interface Char2ObjectMap<V>compute in class AbstractChar2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(char key, CharFunction<V> mappingFunction)
Char2ObjectMapcomputeIfAbsent in interface Char2ObjectMap<V>computeIfAbsent in class AbstractChar2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V supplyIfAbsent(char key, ObjectSupplier<V> valueProvider)
Char2ObjectMapsupplyIfAbsent in interface Char2ObjectMap<V>supplyIfAbsent in class AbstractChar2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(char key, CharObjectUnaryOperator<V> mappingFunction)
Char2ObjectMapcomputeIfPresent in interface Char2ObjectMap<V>computeIfPresent in class AbstractChar2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(char key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Char2ObjectMapmerge in interface Char2ObjectMap<V>merge in class AbstractChar2ObjectMap<V>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void clear()
public boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic boolean isEmpty()
public int size()
public ObjectSet<Char2ObjectMap.Entry<V>> char2ObjectEntrySet()
Char2ObjectMapchar2ObjectEntrySet in interface Char2ObjectMap<V>public CharSet keySet()
keySet in interface java.util.Map<java.lang.Character,V>keySet in interface Char2ObjectMap<V>keySet in class AbstractChar2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Character,V>values in interface Char2ObjectMap<V>values in class AbstractChar2ObjectMap<V>