T - the type of elements maintained by this Collectionpublic class Enum2CharMap<T extends java.lang.Enum<T>> extends AbstractObject2CharMap<T>
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 |
|---|
Enum2CharMap(java.lang.Class<T> keyType)
Default Constructor
|
Enum2CharMap(java.util.Map<? extends T,? extends java.lang.Character> map)
A Helper constructor that allows to create a EnumMap with exactly the same values as the provided map.
|
Enum2CharMap(Object2CharMap<T> map)
A Type Specific Helper function that allows to create a new EnumMap with exactly the same values as the provided map.
|
Enum2CharMap(T[] keys,
char[] values)
Helper constructor that allow to create a EnumMap from unboxed values
|
Enum2CharMap(T[] keys,
java.lang.Character[] values)
Helper constructor that allow to create a EnumMap 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
|
Enum2CharMap<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
|
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(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, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceChars, replaceChars, setDefaultReturnValuebuilder, compute, computeIfAbsent, computeIfPresent, containsValue, forEach, merge, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic Enum2CharMap(java.lang.Class<T> keyType)
keyType - the type of Enum that should be usedpublic Enum2CharMap(T[] keys, java.lang.Character[] values)
keys - the keys that should be put into the EnumMapvalues - the values that should be put into the EnumMap.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Enum2CharMap(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 Enum2CharMap(java.util.Map<? extends T,? extends java.lang.Character> map)
map - the values that should be present in the mappublic Enum2CharMap(Object2CharMap<T> map)
map - the values that should be present in the mappublic char put(T key, char value)
Object2CharMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public char putIfAbsent(T key, char value)
Object2CharMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public char addTo(T key, char value)
Object2CharMapkey - 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 removedkey - that should be subtract fromvalue - that should be subtractpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Character>containsKey in class AbstractObject2CharMap<T extends java.lang.Enum<T>>public boolean containsValue(char value)
Object2CharMapcontainsValue in interface Object2CharMap<T extends java.lang.Enum<T>>containsValue in class AbstractObject2CharMap<T extends java.lang.Enum<T>>value - element that is searched forpublic java.lang.Character remove(java.lang.Object key)
remove in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Character>remove in interface Object2CharMap<T extends java.lang.Enum<T>>remove in class AbstractObject2CharMap<T extends java.lang.Enum<T>>key - the element that should be removedMap.remove(Object)public char rem(T key)
Object2CharMapkey - the element that should be removedpublic char remOrDefault(T key, char defaultValue)
Object2CharMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(T key, char value)
Object2CharMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public char getChar(T key)
Object2CharMapkey - the key that is searched forpublic char getOrDefault(T key, char defaultValue)
Object2CharMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Enum2CharMap<T> copy()
Object2CharMapcopy in interface Object2CharMap<T extends java.lang.Enum<T>>copy in class AbstractObject2CharMap<T extends java.lang.Enum<T>>public ObjectSet<Object2CharMap.Entry<T>> object2CharEntrySet()
Object2CharMappublic ObjectSet<T> keySet()
keySet in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Character>keySet in interface Object2CharMap<T extends java.lang.Enum<T>>keySet in class AbstractObject2CharMap<T extends java.lang.Enum<T>>public CharCollection values()
values in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Character>values in interface Object2CharMap<T extends java.lang.Enum<T>>values in class AbstractObject2CharMap<T extends java.lang.Enum<T>>public void forEach(ObjectCharConsumer<T> action)
Object2CharMapforEach in interface Object2CharMap<T extends java.lang.Enum<T>>forEach in class AbstractObject2CharMap<T extends java.lang.Enum<T>>action - processor of the values that are iterator overpublic boolean replace(T key, char oldValue, char newValue)
Object2CharMapreplace in interface Object2CharMap<T extends java.lang.Enum<T>>replace in class AbstractObject2CharMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>replace in class AbstractObject2CharMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>computeChar in class AbstractObject2CharMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>computeCharIfAbsent in class AbstractObject2CharMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>supplyCharIfAbsent in class AbstractObject2CharMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>computeCharIfPresent in class AbstractObject2CharMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>mergeChar in class AbstractObject2CharMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>mergeAllChar in class AbstractObject2CharMap<T extends java.lang.Enum<T>>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void clear()