T - the type of elements maintained by this Collectionpublic class ImmutableObject2CharOpenHashMap<T> extends AbstractObject2CharMap<T> implements Object2CharOrderedMap<T>
AbstractObject2CharMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2CharOrderedMap.FastOrderedSet<T>Object2CharMap.BuilderCache<T>, Object2CharMap.Entry<T>, Object2CharMap.FastEntrySet<T>, Object2CharMap.MapBuilder| Constructor and Description |
|---|
ImmutableObject2CharOpenHashMap(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.
|
ImmutableObject2CharOpenHashMap(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.
|
ImmutableObject2CharOpenHashMap(Object2CharMap<T> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
ImmutableObject2CharOpenHashMap(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.
|
ImmutableObject2CharOpenHashMap(T[] keys,
char[] values)
Helper constructor that allow to create a map from unboxed values
|
ImmutableObject2CharOpenHashMap(T[] keys,
char[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
ImmutableObject2CharOpenHashMap(T[] keys,
java.lang.Character[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
ImmutableObject2CharOpenHashMap(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() |
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.
|
ImmutableObject2CharOpenHashMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
char |
firstCharValue()
A method to get the first Value of a Map.
|
T |
firstKey()
A method to get the first Key of a Map.
|
void |
forEach(ObjectCharConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Character |
get(java.lang.Object key) |
char |
getAndMoveToFirst(T key)
A Specific get method that allows to move teh given key/value int the first index.
|
char |
getAndMoveToLast(T key)
A Specific get method that allows to move teh given key/value int the last index.
|
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
|
ObjectOrderedSet<T> |
keySet() |
char |
lastCharValue()
A method to get the last Value of a Map.
|
T |
lastKey()
A method to get the last Key of a Map.
|
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
|
boolean |
moveToFirst(T key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(T key)
A specific move method to move a given key/value to the last index.
|
ObjectOrderedSet<Object2CharMap.Entry<T>> |
object2CharEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
T |
pollFirstKey()
A method to get and remove the first Key of a Map.
|
T |
pollLastKey()
A method to get and remove the last Key of a Map.
|
char |
put(T key,
char value)
Type Specific method to reduce boxing/unboxing of values
|
char |
putAndMoveToFirst(T key,
char value)
A customized put method that allows you to insert into the first index.
|
char |
putAndMoveToLast(T key,
char value)
A customized put method that allows you to insert into the last index.
|
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)
Deprecated.
|
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
|
CharCollection |
values() |
addToAll, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceChars, replaceChars, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceChars, replaceChars, setDefaultReturnValuepublic ImmutableObject2CharOpenHashMap(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 ImmutableObject2CharOpenHashMap(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 ImmutableObject2CharOpenHashMap(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 ImmutableObject2CharOpenHashMap(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 ImmutableObject2CharOpenHashMap(java.util.Map<? extends T,? extends java.lang.Character> map)
map - the values that should be present in the mappublic ImmutableObject2CharOpenHashMap(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 ImmutableObject2CharOpenHashMap(Object2CharMap<T> map)
map - the values that should be present in the mappublic ImmutableObject2CharOpenHashMap(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 char putAndMoveToFirst(T key, char value)
Object2CharOrderedMapputAndMoveToFirst in interface Object2CharOrderedMap<T>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public char putAndMoveToLast(T key, char value)
Object2CharOrderedMapputAndMoveToLast in interface Object2CharOrderedMap<T>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(T key)
Object2CharOrderedMapmoveToFirst in interface Object2CharOrderedMap<T>key - that should be moved to the first indexpublic boolean moveToLast(T key)
Object2CharOrderedMapmoveToLast in interface Object2CharOrderedMap<T>key - that should be moved to the first lastpublic char getAndMoveToFirst(T key)
Object2CharOrderedMapgetAndMoveToFirst in interface Object2CharOrderedMap<T>key - that is searched forpublic char getAndMoveToLast(T key)
Object2CharOrderedMapgetAndMoveToLast in interface Object2CharOrderedMap<T>key - that is searched forpublic 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)@Deprecated 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 T firstKey()
Object2CharOrderedMapfirstKey in interface Object2CharOrderedMap<T>public T pollFirstKey()
Object2CharOrderedMappollFirstKey in interface Object2CharOrderedMap<T>public T lastKey()
Object2CharOrderedMaplastKey in interface Object2CharOrderedMap<T>public T pollLastKey()
Object2CharOrderedMappollLastKey in interface Object2CharOrderedMap<T>public char firstCharValue()
Object2CharOrderedMapfirstCharValue in interface Object2CharOrderedMap<T>public char lastCharValue()
Object2CharOrderedMaplastCharValue in interface Object2CharOrderedMap<T>public ObjectOrderedSet<Object2CharMap.Entry<T>> object2CharEntrySet()
Object2CharMapobject2CharEntrySet in interface Object2CharMap<T>object2CharEntrySet in interface Object2CharOrderedMap<T>public ObjectOrderedSet<T> keySet()
keySet in interface java.util.Map<T,java.lang.Character>keySet in interface Object2CharMap<T>keySet in interface Object2CharOrderedMap<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 ImmutableObject2CharOpenHashMap<T> copy()
Object2CharMapcopy in interface Object2CharMap<T>copy in interface Object2CharOrderedMap<T>copy 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()