T - the type of elements maintained by this Collectionpublic class Object2CharOpenHashMap<T> extends AbstractObject2CharMap<T> implements ITrimmable
AbstractObject2CharMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2CharMap.BuilderCache<T>, Object2CharMap.Entry<T>, Object2CharMap.FastEntrySet<T>, Object2CharMap.MapBuilder| Constructor and Description |
|---|
Object2CharOpenHashMap()
Default Constructor
|
Object2CharOpenHashMap(int minCapacity)
Constructor that defines the minimum capacity
|
Object2CharOpenHashMap(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
Object2CharOpenHashMap(java.util.Map<? extends T,? extends java.lang.Character> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2CharOpenHashMap(java.util.Map<? extends T,? extends java.lang.Character> map,
float loadFactor)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2CharOpenHashMap(Object2CharMap<T> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2CharOpenHashMap(Object2CharMap<T> map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2CharOpenHashMap(T[] keys,
char[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2CharOpenHashMap(T[] keys,
char[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
Object2CharOpenHashMap(T[] keys,
java.lang.Character[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Object2CharOpenHashMap(T[] keys,
java.lang.Character[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
| Modifier and Type | Method and Description |
|---|---|
char |
addTo(T key,
char value)
A Helper method to add a primitives together.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
char |
computeChar(T key,
ObjectCharUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
char |
computeCharIfAbsent(T key,
Object2CharFunction<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
char |
computeCharIfPresent(T key,
ObjectCharUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(char value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
Object2CharOpenHashMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(ObjectCharConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Character |
get(java.lang.Object key) |
char |
getChar(T key)
A Type Specific get method to reduce boxing/unboxing
|
char |
getOrDefault(T key,
char defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<T> |
keySet() |
void |
mergeAllChar(Object2CharMap<T> m,
CharCharUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
char |
mergeChar(T key,
char value,
CharCharUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
ObjectSet<Object2CharMap.Entry<T>> |
object2CharEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
char |
put(T key,
char value)
Type Specific method to reduce boxing/unboxing of values
|
char |
putIfAbsent(T key,
char value)
Type Specific method to reduce boxing/unboxing of values
|
char |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
char |
remOrDefault(T key,
char defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
java.lang.Character |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
boolean |
remove(T key,
char value)
Type Specific remove function to reduce boxing/unboxing
|
char |
replace(T key,
char value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
char oldValue,
char newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
char |
subFrom(T key,
char value)
A Helper method to subtract from primitive from each other.
|
char |
supplyCharIfAbsent(T key,
CharSupplier 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
|
CharCollection |
values() |
addToAll, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceChars, replaceChars, setDefaultReturnValueclearAndTrim, trimbuilder, compute, computeIfAbsent, computeIfPresent, forEach, merge, putAll, putAll, putIfAbsent, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic Object2CharOpenHashMap()
public Object2CharOpenHashMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Object2CharOpenHashMap(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 Object2CharOpenHashMap(T[] keys, java.lang.Character[] 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 Object2CharOpenHashMap(T[] keys, java.lang.Character[] 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 Object2CharOpenHashMap(T[] keys, char[] 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 Object2CharOpenHashMap(T[] keys, char[] 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 Object2CharOpenHashMap(java.util.Map<? extends T,? extends java.lang.Character> map)
map - the values that should be present in the mappublic Object2CharOpenHashMap(java.util.Map<? extends T,? extends java.lang.Character> 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 Object2CharOpenHashMap(Object2CharMap<T> map)
map - the values that should be present in the mappublic Object2CharOpenHashMap(Object2CharMap<T> 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 char put(T key, char value)
Object2CharMapput in interface Object2CharMap<T>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public char putIfAbsent(T key, char value)
Object2CharMapputIfAbsent in interface Object2CharMap<T>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public char addTo(T key, char value)
Object2CharMapaddTo in interface Object2CharMap<T>key - the key that should be inserted,value - the value that should be inserted / addedpublic char subFrom(T key, char value)
Object2CharMapObject2CharMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Object2CharMap<T>key - that should be subtract fromvalue - that should be subtractpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,java.lang.Character>containsKey in class AbstractObject2CharMap<T>public boolean containsValue(char value)
Object2CharMapcontainsValue in interface Object2CharMap<T>containsValue in class AbstractObject2CharMap<T>value - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<T,java.lang.Character>containsValue in interface Object2CharMap<T>containsValue in class java.util.AbstractMap<T,java.lang.Character>value - that is searched for.Map.containsValue(Object)public char rem(T key)
Object2CharMaprem in interface Object2CharMap<T>key - the element that should be removedpublic char remOrDefault(T key, char defaultValue)
Object2CharMapremOrDefault in interface Object2CharMap<T>key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public java.lang.Character remove(java.lang.Object key)
remove in interface java.util.Map<T,java.lang.Character>remove in interface Object2CharMap<T>remove in class AbstractObject2CharMap<T>key - the element that should be removedMap.remove(Object)public boolean remove(T key, char value)
Object2CharMapremove in interface Object2CharMap<T>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.Map<T,java.lang.Character>remove in interface Object2CharMap<T>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public char getChar(T key)
Object2CharMapgetChar in interface Object2CharFunction<T>getChar in interface Object2CharMap<T>key - the key that is searched forpublic java.lang.Character get(java.lang.Object key)
get in interface java.util.Map<T,java.lang.Character>get in interface Object2CharMap<T>get in class AbstractObject2CharMap<T>public char getOrDefault(T key, char defaultValue)
Object2CharMapgetOrDefault in interface Object2CharMap<T>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Object2CharOpenHashMap<T> copy()
Object2CharMapcopy in interface Object2CharMap<T>copy in class AbstractObject2CharMap<T>public ObjectSet<Object2CharMap.Entry<T>> object2CharEntrySet()
Object2CharMapobject2CharEntrySet in interface Object2CharMap<T>public ObjectSet<T> keySet()
keySet in interface java.util.Map<T,java.lang.Character>keySet in interface Object2CharMap<T>keySet in class AbstractObject2CharMap<T>public CharCollection values()
values in interface java.util.Map<T,java.lang.Character>values in interface Object2CharMap<T>values in class AbstractObject2CharMap<T>public void forEach(ObjectCharConsumer<T> action)
Object2CharMapforEach in interface Object2CharMap<T>forEach in class AbstractObject2CharMap<T>action - processor of the values that are iterator overpublic boolean replace(T key, char oldValue, char newValue)
Object2CharMapreplace in interface Object2CharMap<T>replace in class AbstractObject2CharMap<T>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public char replace(T key, char value)
Object2CharMapreplace in interface Object2CharMap<T>replace in class AbstractObject2CharMap<T>key - the element that should be searched forvalue - the value to replace with.public char computeChar(T key, ObjectCharUnaryOperator<T> mappingFunction)
Object2CharMapcomputeChar in interface Object2CharMap<T>computeChar in class AbstractObject2CharMap<T>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic char computeCharIfAbsent(T key, Object2CharFunction<T> mappingFunction)
Object2CharMapcomputeCharIfAbsent in interface Object2CharMap<T>computeCharIfAbsent in class AbstractObject2CharMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic char supplyCharIfAbsent(T key, CharSupplier valueProvider)
Object2CharMapsupplyCharIfAbsent in interface Object2CharMap<T>supplyCharIfAbsent in class AbstractObject2CharMap<T>key - the key that should be computedvalueProvider - the value if not presentpublic char computeCharIfPresent(T key, ObjectCharUnaryOperator<T> mappingFunction)
Object2CharMapcomputeCharIfPresent in interface Object2CharMap<T>computeCharIfPresent in class AbstractObject2CharMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic char mergeChar(T key, char value, CharCharUnaryOperator mappingFunction)
Object2CharMapmergeChar in interface Object2CharMap<T>mergeChar in class AbstractObject2CharMap<T>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 mergeAllChar(Object2CharMap<T> m, CharCharUnaryOperator mappingFunction)
Object2CharMapmergeAllChar in interface Object2CharMap<T>mergeAllChar in class AbstractObject2CharMap<T>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
public 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 allowed