public class Char2ByteArrayMap extends AbstractChar2ByteMap implements Char2ByteOrderedMap
AbstractChar2ByteMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Char2ByteOrderedMap.FastOrderedSetChar2ByteMap.BuilderCache, Char2ByteMap.Entry, Char2ByteMap.FastEntrySet, Char2ByteMap.MapBuilder| Constructor and Description |
|---|
Char2ByteArrayMap()
Default Constructor
|
Char2ByteArrayMap(char[] keys,
byte[] values)
Helper constructor that allow to create a map from unboxed values
|
Char2ByteArrayMap(char[] keys,
byte[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Char2ByteArrayMap(Char2ByteMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2ByteArrayMap(java.lang.Character[] keys,
java.lang.Byte[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2ByteArrayMap(java.lang.Character[] keys,
java.lang.Byte[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Char2ByteArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Char2ByteArrayMap(java.util.Map<? extends java.lang.Character,? extends java.lang.Byte> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
addTo(char key,
byte value)
A Helper method to add a primitives together.
|
ObjectOrderedSet<Char2ByteMap.Entry> |
char2ByteEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
clear() |
byte |
computeByte(char key,
CharByteUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
byte |
computeByteIfAbsent(char key,
Char2ByteFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
byte |
computeByteIfPresent(char key,
CharByteUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(char key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(byte value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
Char2ByteArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
byte |
firstByteValue()
A method to get the first Value of a Map.
|
char |
firstCharKey()
A method to get the first Key of a Map.
|
void |
forEach(CharByteConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
byte |
get(char key)
A Type Specific get method to reduce boxing/unboxing
|
byte |
getAndMoveToFirst(char key)
A Specific get method that allows to move teh given key/value int the first index.
|
byte |
getAndMoveToLast(char key)
A Specific get method that allows to move teh given key/value int the last index.
|
byte |
getOrDefault(char key,
byte defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
CharOrderedSet |
keySet() |
byte |
lastByteValue()
A method to get the last Value of a Map.
|
char |
lastCharKey()
A method to get the last Key of a Map.
|
void |
mergeAllByte(Char2ByteMap m,
ByteByteUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
byte |
mergeByte(char key,
byte value,
ByteByteUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(char key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(char key)
A specific move method to move a given key/value to the last index.
|
char |
pollFirstCharKey()
A method to get and remove the first Key of a Map.
|
char |
pollLastCharKey()
A method to get and remove the last Key of a Map.
|
byte |
put(char key,
byte value)
Type Specific method to reduce boxing/unboxing of values
|
byte |
putAndMoveToFirst(char key,
byte value)
A customized put method that allows you to insert into the first index.
|
byte |
putAndMoveToLast(char key,
byte value)
A customized put method that allows you to insert into the last index.
|
byte |
putIfAbsent(char key,
byte value)
Type Specific method to reduce boxing/unboxing of values
|
byte |
remove(char key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(char key,
byte value)
Type Specific remove function to reduce boxing/unboxing
|
java.lang.Byte |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
byte |
removeOrDefault(char key,
byte defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
byte |
replace(char key,
byte value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(char key,
byte oldValue,
byte newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
byte |
subFrom(char key,
byte value)
A Helper method to subtract from primitive from each other.
|
byte |
supplyByteIfAbsent(char key,
ByteSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ByteCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceBytes, replaceBytes, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, applyAsByte, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceBytes, replaceBytes, setDefaultReturnValuepublic Char2ByteArrayMap()
public Char2ByteArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Char2ByteArrayMap(java.lang.Character[] keys,
java.lang.Byte[] 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 lengthpublic Char2ByteArrayMap(java.lang.Character[] keys,
java.lang.Byte[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lengthpublic Char2ByteArrayMap(char[] keys,
byte[] 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 Char2ByteArrayMap(char[] keys,
byte[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Char2ByteArrayMap(java.util.Map<? extends java.lang.Character,? extends java.lang.Byte> map)
map - the values that should be present in the mappublic Char2ByteArrayMap(Char2ByteMap map)
map - the values that should be present in the mappublic byte put(char key,
byte value)
Char2ByteMapput in interface Char2ByteMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public byte putIfAbsent(char key,
byte value)
Char2ByteMapputIfAbsent in interface Char2ByteMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public byte addTo(char key,
byte value)
Char2ByteMapaddTo in interface Char2ByteMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic byte subFrom(char key,
byte value)
Char2ByteMapChar2ByteMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Char2ByteMapkey - that should be subtract fromvalue - that should be subtractpublic byte putAndMoveToFirst(char key,
byte value)
Char2ByteOrderedMapputAndMoveToFirst in interface Char2ByteOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public byte putAndMoveToLast(char key,
byte value)
Char2ByteOrderedMapputAndMoveToLast in interface Char2ByteOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(char key)
Char2ByteOrderedMapmoveToFirst in interface Char2ByteOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(char key)
Char2ByteOrderedMapmoveToLast in interface Char2ByteOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(char key)
Char2ByteMapcontainsKey in interface Char2ByteMapcontainsKey in class AbstractChar2ByteMapkey - element that is searched forpublic boolean containsValue(byte value)
Char2ByteMapcontainsValue in interface Char2ByteMapcontainsValue in class AbstractChar2ByteMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Character,java.lang.Byte>containsKey in interface Char2ByteMapcontainsKey in class java.util.AbstractMap<java.lang.Character,java.lang.Byte>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Character,java.lang.Byte>containsValue in interface Char2ByteMapcontainsValue in class java.util.AbstractMap<java.lang.Character,java.lang.Byte>value - that is searched for.Map.containsValue(Object)public byte get(char key)
Char2ByteMapget in interface Char2ByteMapkey - the key that is searched forpublic byte getOrDefault(char key,
byte defaultValue)
Char2ByteMapgetOrDefault in interface Char2ByteMapgetOrDefault in class AbstractChar2ByteMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic byte getAndMoveToFirst(char key)
Char2ByteOrderedMapgetAndMoveToFirst in interface Char2ByteOrderedMapkey - that is searched forpublic byte getAndMoveToLast(char key)
Char2ByteOrderedMapgetAndMoveToLast in interface Char2ByteOrderedMapkey - that is searched forpublic char firstCharKey()
Char2ByteOrderedMapfirstCharKey in interface Char2ByteOrderedMappublic char lastCharKey()
Char2ByteOrderedMaplastCharKey in interface Char2ByteOrderedMappublic byte firstByteValue()
Char2ByteOrderedMapfirstByteValue in interface Char2ByteOrderedMappublic byte lastByteValue()
Char2ByteOrderedMaplastByteValue in interface Char2ByteOrderedMappublic char pollFirstCharKey()
Char2ByteOrderedMappollFirstCharKey in interface Char2ByteOrderedMappublic char pollLastCharKey()
Char2ByteOrderedMappollLastCharKey in interface Char2ByteOrderedMappublic byte remove(char key)
Char2ByteMapremove in interface Char2ByteMapkey - the element that should be removedpublic byte removeOrDefault(char key,
byte defaultValue)
Char2ByteMapremoveOrDefault in interface Char2ByteMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(char key,
byte value)
Char2ByteMapremove in interface Char2ByteMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public java.lang.Byte remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Character,java.lang.Byte>remove in interface Char2ByteMapremove in class AbstractChar2ByteMapkey - the element that should be removedMap.remove(Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<java.lang.Character,java.lang.Byte>remove in interface Char2ByteMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(CharByteConsumer action)
Char2ByteMapforEach in interface Char2ByteMapforEach in class AbstractChar2ByteMapaction - processor of the values that are iterator overpublic CharOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Character,java.lang.Byte>keySet in interface Char2ByteMapkeySet in interface Char2ByteOrderedMapkeySet in class AbstractChar2ByteMappublic ByteCollection values()
values in interface java.util.Map<java.lang.Character,java.lang.Byte>values in interface Char2ByteMapvalues in class AbstractChar2ByteMappublic ObjectOrderedSet<Char2ByteMap.Entry> char2ByteEntrySet()
Char2ByteMapchar2ByteEntrySet in interface Char2ByteMapchar2ByteEntrySet in interface Char2ByteOrderedMappublic boolean replace(char key,
byte oldValue,
byte newValue)
Char2ByteMapreplace in interface Char2ByteMapreplace in class AbstractChar2ByteMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public byte replace(char key,
byte value)
Char2ByteMapreplace in interface Char2ByteMapreplace in class AbstractChar2ByteMapkey - the element that should be searched forvalue - the value to replace with.public byte computeByte(char key,
CharByteUnaryOperator mappingFunction)
Char2ByteMapcomputeByte in interface Char2ByteMapcomputeByte in class AbstractChar2ByteMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic byte computeByteIfAbsent(char key,
Char2ByteFunction mappingFunction)
Char2ByteMapcomputeByteIfAbsent in interface Char2ByteMapcomputeByteIfAbsent in class AbstractChar2ByteMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic byte supplyByteIfAbsent(char key,
ByteSupplier valueProvider)
Char2ByteMapsupplyByteIfAbsent in interface Char2ByteMapsupplyByteIfAbsent in class AbstractChar2ByteMapkey - the key that should be computedvalueProvider - the value if not presentpublic byte computeByteIfPresent(char key,
CharByteUnaryOperator mappingFunction)
Char2ByteMapcomputeByteIfPresent in interface Char2ByteMapcomputeByteIfPresent in class AbstractChar2ByteMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic byte mergeByte(char key,
byte value,
ByteByteUnaryOperator mappingFunction)
Char2ByteMapmergeByte in interface Char2ByteMapmergeByte in class AbstractChar2ByteMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllByte(Char2ByteMap m, ByteByteUnaryOperator mappingFunction)
Char2ByteMapmergeAllByte in interface Char2ByteMapmergeAllByte in class AbstractChar2ByteMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
size in interface java.util.Map<java.lang.Character,java.lang.Byte>size in class java.util.AbstractMap<java.lang.Character,java.lang.Byte>public void clear()
clear in interface java.util.Map<java.lang.Character,java.lang.Byte>clear in class java.util.AbstractMap<java.lang.Character,java.lang.Byte>public Char2ByteArrayMap copy()
Char2ByteMapcopy in interface Char2ByteMapcopy in interface Char2ByteOrderedMapcopy in class AbstractChar2ByteMap