public class Short2ByteArrayMap extends AbstractShort2ByteMap implements Short2ByteOrderedMap
AbstractShort2ByteMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Short2ByteOrderedMap.FastOrderedSetShort2ByteMap.BuilderCache, Short2ByteMap.Entry, Short2ByteMap.FastEntrySet, Short2ByteMap.MapBuilder| Constructor and Description |
|---|
Short2ByteArrayMap()
Default Constructor
|
Short2ByteArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Short2ByteArrayMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Byte> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Short2ByteArrayMap(short[] keys,
byte[] values)
Helper constructor that allow to create a map from unboxed values
|
Short2ByteArrayMap(java.lang.Short[] keys,
java.lang.Byte[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Short2ByteArrayMap(short[] keys,
byte[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Short2ByteArrayMap(java.lang.Short[] 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
|
Short2ByteArrayMap(Short2ByteMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
addTo(short key,
byte value)
A Helper method to add a primitives together.
|
void |
clear() |
byte |
computeByte(short key,
ShortByteUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
byte |
computeByteIfAbsent(short key,
Short2ByteFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
byte |
computeByteIfPresent(short key,
ShortByteUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsKey(short key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(byte value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
Short2ByteArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
byte |
firstByteValue()
A method to get the first Value of a Map.
|
short |
firstShortKey()
A method to get the first Key of a Map.
|
void |
forEach(ShortByteConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
byte |
get(short key)
A Type Specific get method to reduce boxing/unboxing
|
byte |
getAndMoveToFirst(short key)
A Specific get method that allows to move teh given key/value int the first index.
|
byte |
getAndMoveToLast(short key)
A Specific get method that allows to move teh given key/value int the last index.
|
byte |
getOrDefault(short key,
byte defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ShortOrderedSet |
keySet() |
byte |
lastByteValue()
A method to get the last Value of a Map.
|
short |
lastShortKey()
A method to get the last Key of a Map.
|
void |
mergeAllByte(Short2ByteMap m,
ByteByteUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
byte |
mergeByte(short key,
byte value,
ByteByteUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(short key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(short key)
A specific move method to move a given key/value to the last index.
|
short |
pollFirstShortKey()
A method to get and remove the first Key of a Map.
|
short |
pollLastShortKey()
A method to get and remove the last Key of a Map.
|
byte |
put(short key,
byte value)
Type Specific method to reduce boxing/unboxing of values
|
byte |
putAndMoveToFirst(short key,
byte value)
A customized put method that allows you to insert into the first index.
|
byte |
putAndMoveToLast(short key,
byte value)
A customized put method that allows you to insert into the last index.
|
byte |
putIfAbsent(short key,
byte value)
Type Specific method to reduce boxing/unboxing of values
|
java.lang.Byte |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
byte |
remove(short key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(short key,
byte value)
Type Specific remove function to reduce boxing/unboxing
|
byte |
removeOrDefault(short key,
byte defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
byte |
replace(short key,
byte value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(short key,
byte oldValue,
byte newValue)
A Type Specific replace method to replace an existing value
|
ObjectOrderedSet<Short2ByteMap.Entry> |
short2ByteEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
int |
size() |
byte |
subFrom(short key,
byte value)
A Helper method to subtract from primitive from each other.
|
byte |
supplyByteIfAbsent(short 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, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceBytes, replaceBytes, setDefaultReturnValuepublic Short2ByteArrayMap()
public Short2ByteArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Short2ByteArrayMap(java.lang.Short[] 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 Short2ByteArrayMap(java.lang.Short[] 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 Short2ByteArrayMap(short[] 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 Short2ByteArrayMap(short[] 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 Short2ByteArrayMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Byte> map)
map - the values that should be present in the mappublic Short2ByteArrayMap(Short2ByteMap map)
map - the values that should be present in the mappublic byte put(short key,
byte value)
Short2ByteMapput in interface Short2ByteMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public byte putIfAbsent(short key,
byte value)
Short2ByteMapputIfAbsent in interface Short2ByteMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public byte addTo(short key,
byte value)
Short2ByteMapaddTo in interface Short2ByteMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic byte subFrom(short key,
byte value)
Short2ByteMapShort2ByteMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Short2ByteMapkey - that should be subtract fromvalue - that should be subtractpublic byte putAndMoveToFirst(short key,
byte value)
Short2ByteOrderedMapputAndMoveToFirst in interface Short2ByteOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public byte putAndMoveToLast(short key,
byte value)
Short2ByteOrderedMapputAndMoveToLast in interface Short2ByteOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(short key)
Short2ByteOrderedMapmoveToFirst in interface Short2ByteOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(short key)
Short2ByteOrderedMapmoveToLast in interface Short2ByteOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(short key)
Short2ByteMapcontainsKey in interface Short2ByteMapcontainsKey in class AbstractShort2ByteMapkey - element that is searched forpublic boolean containsValue(byte value)
Short2ByteMapcontainsValue in interface Short2ByteMapcontainsValue in class AbstractShort2ByteMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Short,java.lang.Byte>containsKey in interface Short2ByteMapcontainsKey in class java.util.AbstractMap<java.lang.Short,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.Short,java.lang.Byte>containsValue in interface Short2ByteMapcontainsValue in class java.util.AbstractMap<java.lang.Short,java.lang.Byte>value - that is searched for.Map.containsValue(Object)public byte get(short key)
Short2ByteMapget in interface Short2ByteFunctionget in interface Short2ByteMapkey - the key that is searched forpublic byte getOrDefault(short key,
byte defaultValue)
Short2ByteMapgetOrDefault in interface Short2ByteMapgetOrDefault in class AbstractShort2ByteMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic byte getAndMoveToFirst(short key)
Short2ByteOrderedMapgetAndMoveToFirst in interface Short2ByteOrderedMapkey - that is searched forpublic byte getAndMoveToLast(short key)
Short2ByteOrderedMapgetAndMoveToLast in interface Short2ByteOrderedMapkey - that is searched forpublic short firstShortKey()
Short2ByteOrderedMapfirstShortKey in interface Short2ByteOrderedMappublic short lastShortKey()
Short2ByteOrderedMaplastShortKey in interface Short2ByteOrderedMappublic byte firstByteValue()
Short2ByteOrderedMapfirstByteValue in interface Short2ByteOrderedMappublic byte lastByteValue()
Short2ByteOrderedMaplastByteValue in interface Short2ByteOrderedMappublic short pollFirstShortKey()
Short2ByteOrderedMappollFirstShortKey in interface Short2ByteOrderedMappublic short pollLastShortKey()
Short2ByteOrderedMappollLastShortKey in interface Short2ByteOrderedMappublic byte remove(short key)
Short2ByteMapremove in interface Short2ByteMapkey - the element that should be removedpublic byte removeOrDefault(short key,
byte defaultValue)
Short2ByteMapremoveOrDefault in interface Short2ByteMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(short key,
byte value)
Short2ByteMapremove in interface Short2ByteMapkey - 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.Short,java.lang.Byte>remove in interface Short2ByteMapremove in class AbstractShort2ByteMapkey - 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.Short,java.lang.Byte>remove in interface Short2ByteMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(ShortByteConsumer action)
Short2ByteMapforEach in interface Short2ByteMapforEach in class AbstractShort2ByteMapaction - processor of the values that are iterator overpublic ShortOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Short,java.lang.Byte>keySet in interface Short2ByteMapkeySet in interface Short2ByteOrderedMapkeySet in class AbstractShort2ByteMappublic ByteCollection values()
values in interface java.util.Map<java.lang.Short,java.lang.Byte>values in interface Short2ByteMapvalues in class AbstractShort2ByteMappublic ObjectOrderedSet<Short2ByteMap.Entry> short2ByteEntrySet()
Short2ByteMapshort2ByteEntrySet in interface Short2ByteMapshort2ByteEntrySet in interface Short2ByteOrderedMappublic boolean replace(short key,
byte oldValue,
byte newValue)
Short2ByteMapreplace in interface Short2ByteMapreplace in class AbstractShort2ByteMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public byte replace(short key,
byte value)
Short2ByteMapreplace in interface Short2ByteMapreplace in class AbstractShort2ByteMapkey - the element that should be searched forvalue - the value to replace with.public byte computeByte(short key,
ShortByteUnaryOperator mappingFunction)
Short2ByteMapcomputeByte in interface Short2ByteMapcomputeByte in class AbstractShort2ByteMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic byte computeByteIfAbsent(short key,
Short2ByteFunction mappingFunction)
Short2ByteMapcomputeByteIfAbsent in interface Short2ByteMapcomputeByteIfAbsent in class AbstractShort2ByteMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic byte supplyByteIfAbsent(short key,
ByteSupplier valueProvider)
Short2ByteMapsupplyByteIfAbsent in interface Short2ByteMapsupplyByteIfAbsent in class AbstractShort2ByteMapkey - the key that should be computedvalueProvider - the value if not presentpublic byte computeByteIfPresent(short key,
ShortByteUnaryOperator mappingFunction)
Short2ByteMapcomputeByteIfPresent in interface Short2ByteMapcomputeByteIfPresent in class AbstractShort2ByteMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic byte mergeByte(short key,
byte value,
ByteByteUnaryOperator mappingFunction)
Short2ByteMapmergeByte in interface Short2ByteMapmergeByte in class AbstractShort2ByteMapkey - 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(Short2ByteMap m, ByteByteUnaryOperator mappingFunction)
Short2ByteMapmergeAllByte in interface Short2ByteMapmergeAllByte in class AbstractShort2ByteMapm - 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.Short,java.lang.Byte>size in class java.util.AbstractMap<java.lang.Short,java.lang.Byte>public void clear()
clear in interface java.util.Map<java.lang.Short,java.lang.Byte>clear in class java.util.AbstractMap<java.lang.Short,java.lang.Byte>public Short2ByteArrayMap copy()
Short2ByteMapcopy in interface Short2ByteMapcopy in interface Short2ByteOrderedMapcopy in class AbstractShort2ByteMap