public class Long2ShortArrayMap extends AbstractLong2ShortMap implements Long2ShortOrderedMap
AbstractLong2ShortMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ShortOrderedMap.FastOrderedSetLong2ShortMap.BuilderCache, Long2ShortMap.Entry, Long2ShortMap.FastEntrySet, Long2ShortMap.MapBuilder| Constructor and Description |
|---|
Long2ShortArrayMap()
Default Constructor
|
Long2ShortArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Long2ShortArrayMap(long[] keys,
short[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2ShortArrayMap(java.lang.Long[] keys,
java.lang.Short[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2ShortArrayMap(long[] keys,
short[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Long2ShortArrayMap(java.lang.Long[] keys,
java.lang.Short[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Long2ShortArrayMap(Long2ShortMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2ShortArrayMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Short> 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 |
|---|---|
short |
addTo(long key,
short value)
A Helper method to add a primitives together.
|
void |
clear() |
short |
computeShort(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
boolean |
containsValue(short value)
Type Specific method to reduce boxing/unboxing of values
|
Long2ShortArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
long |
firstLongKey()
A method to get the first Key of a Map.
|
short |
firstShortValue()
A method to get the first Value of a Map.
|
void |
forEach(LongShortConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
short |
get(long key)
A Type Specific get method to reduce boxing/unboxing
|
short |
getAndMoveToFirst(long key)
A Specific get method that allows to move teh given key/value int the first index.
|
short |
getAndMoveToLast(long key)
A Specific get method that allows to move teh given key/value int the last index.
|
short |
getOrDefault(long key,
short defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
LongOrderedSet |
keySet() |
long |
lastLongKey()
A method to get the last Key of a Map.
|
short |
lastShortValue()
A method to get the last Value of a Map.
|
ObjectOrderedSet<Long2ShortMap.Entry> |
long2ShortEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
mergeAllShort(Long2ShortMap m,
ShortShortUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
short |
mergeShort(long key,
short value,
ShortShortUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(long key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(long key)
A specific move method to move a given key/value to the last index.
|
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
long |
pollLastLongKey()
A method to get and remove the last Key of a Map.
|
short |
put(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
putAndMoveToFirst(long key,
short value)
A customized put method that allows you to insert into the first index.
|
short |
putAndMoveToLast(long key,
short value)
A customized put method that allows you to insert into the last index.
|
short |
putIfAbsent(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long key,
short value)
Type Specific remove function to reduce boxing/unboxing
|
java.lang.Short |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
short |
removeOrDefault(long key,
short defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
short |
replace(long key,
short value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
short oldValue,
short newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
short |
subFrom(long key,
short value)
A Helper method to subtract from primitive from each other.
|
short |
supplyShortIfAbsent(long key,
ShortSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ShortCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceShorts, replaceShorts, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, applyAsShort, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceShorts, replaceShorts, setDefaultReturnValuepublic Long2ShortArrayMap()
public Long2ShortArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Long2ShortArrayMap(java.lang.Long[] keys,
java.lang.Short[] 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 Long2ShortArrayMap(java.lang.Long[] keys,
java.lang.Short[] 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 Long2ShortArrayMap(long[] keys,
short[] 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 Long2ShortArrayMap(long[] keys,
short[] 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 Long2ShortArrayMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Short> map)
map - the values that should be present in the mappublic Long2ShortArrayMap(Long2ShortMap map)
map - the values that should be present in the mappublic short put(long key,
short value)
Long2ShortMapput in interface Long2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public short putIfAbsent(long key,
short value)
Long2ShortMapputIfAbsent in interface Long2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public short addTo(long key,
short value)
Long2ShortMapaddTo in interface Long2ShortMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic short subFrom(long key,
short value)
Long2ShortMapLong2ShortMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Long2ShortMapkey - that should be subtract fromvalue - that should be subtractpublic short putAndMoveToFirst(long key,
short value)
Long2ShortOrderedMapputAndMoveToFirst in interface Long2ShortOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public short putAndMoveToLast(long key,
short value)
Long2ShortOrderedMapputAndMoveToLast in interface Long2ShortOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(long key)
Long2ShortOrderedMapmoveToFirst in interface Long2ShortOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(long key)
Long2ShortOrderedMapmoveToLast in interface Long2ShortOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(long key)
Long2ShortMapcontainsKey in interface Long2ShortMapcontainsKey in class AbstractLong2ShortMapkey - element that is searched forpublic boolean containsValue(short value)
Long2ShortMapcontainsValue in interface Long2ShortMapcontainsValue in class AbstractLong2ShortMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Long,java.lang.Short>containsKey in interface Long2ShortMapcontainsKey in class java.util.AbstractMap<java.lang.Long,java.lang.Short>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Long,java.lang.Short>containsValue in interface Long2ShortMapcontainsValue in class java.util.AbstractMap<java.lang.Long,java.lang.Short>value - that is searched for.Map.containsValue(Object)public short get(long key)
Long2ShortMapget in interface Long2ShortMapkey - the key that is searched forpublic short getOrDefault(long key,
short defaultValue)
Long2ShortMapgetOrDefault in interface Long2ShortMapgetOrDefault in class AbstractLong2ShortMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic short getAndMoveToFirst(long key)
Long2ShortOrderedMapgetAndMoveToFirst in interface Long2ShortOrderedMapkey - that is searched forpublic short getAndMoveToLast(long key)
Long2ShortOrderedMapgetAndMoveToLast in interface Long2ShortOrderedMapkey - that is searched forpublic long firstLongKey()
Long2ShortOrderedMapfirstLongKey in interface Long2ShortOrderedMappublic long lastLongKey()
Long2ShortOrderedMaplastLongKey in interface Long2ShortOrderedMappublic short firstShortValue()
Long2ShortOrderedMapfirstShortValue in interface Long2ShortOrderedMappublic short lastShortValue()
Long2ShortOrderedMaplastShortValue in interface Long2ShortOrderedMappublic long pollFirstLongKey()
Long2ShortOrderedMappollFirstLongKey in interface Long2ShortOrderedMappublic long pollLastLongKey()
Long2ShortOrderedMappollLastLongKey in interface Long2ShortOrderedMappublic short remove(long key)
Long2ShortMapremove in interface Long2ShortMapkey - the element that should be removedpublic short removeOrDefault(long key,
short defaultValue)
Long2ShortMapremoveOrDefault in interface Long2ShortMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(long key,
short value)
Long2ShortMapremove in interface Long2ShortMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public java.lang.Short remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Long,java.lang.Short>remove in interface Long2ShortMapremove in class AbstractLong2ShortMapkey - 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.Long,java.lang.Short>remove in interface Long2ShortMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(LongShortConsumer action)
Long2ShortMapforEach in interface Long2ShortMapforEach in class AbstractLong2ShortMapaction - processor of the values that are iterator overpublic LongOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Short>keySet in interface Long2ShortMapkeySet in interface Long2ShortOrderedMapkeySet in class AbstractLong2ShortMappublic ShortCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Short>values in interface Long2ShortMapvalues in class AbstractLong2ShortMappublic ObjectOrderedSet<Long2ShortMap.Entry> long2ShortEntrySet()
Long2ShortMaplong2ShortEntrySet in interface Long2ShortMaplong2ShortEntrySet in interface Long2ShortOrderedMappublic boolean replace(long key,
short oldValue,
short newValue)
Long2ShortMapreplace in interface Long2ShortMapreplace in class AbstractLong2ShortMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public short replace(long key,
short value)
Long2ShortMapreplace in interface Long2ShortMapreplace in class AbstractLong2ShortMapkey - the element that should be searched forvalue - the value to replace with.public short computeShort(long key,
LongShortUnaryOperator mappingFunction)
Long2ShortMapcomputeShort in interface Long2ShortMapcomputeShort in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic short computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
Long2ShortMapcomputeShortIfAbsent in interface Long2ShortMapcomputeShortIfAbsent in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic short supplyShortIfAbsent(long key,
ShortSupplier valueProvider)
Long2ShortMapsupplyShortIfAbsent in interface Long2ShortMapsupplyShortIfAbsent in class AbstractLong2ShortMapkey - the key that should be computedvalueProvider - the value if not presentpublic short computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
Long2ShortMapcomputeShortIfPresent in interface Long2ShortMapcomputeShortIfPresent in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic short mergeShort(long key,
short value,
ShortShortUnaryOperator mappingFunction)
Long2ShortMapmergeShort in interface Long2ShortMapmergeShort in class AbstractLong2ShortMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllShort(Long2ShortMap m, ShortShortUnaryOperator mappingFunction)
Long2ShortMapmergeAllShort in interface Long2ShortMapmergeAllShort in class AbstractLong2ShortMapm - 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.Long,java.lang.Short>size in class java.util.AbstractMap<java.lang.Long,java.lang.Short>public void clear()
clear in interface java.util.Map<java.lang.Long,java.lang.Short>clear in class java.util.AbstractMap<java.lang.Long,java.lang.Short>public Long2ShortArrayMap copy()
Long2ShortMapcopy in interface Long2ShortMapcopy in interface Long2ShortOrderedMapcopy in class AbstractLong2ShortMap