public class Int2ShortConcurrentOpenHashMap extends AbstractInt2ShortMap implements Int2ShortConcurrentMap, ITrimmable
AbstractInt2ShortMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2ShortMap.BuilderCache, Int2ShortMap.Entry, Int2ShortMap.FastEntrySet, Int2ShortMap.MapBuilder| Constructor and Description |
|---|
Int2ShortConcurrentOpenHashMap()
Default Constructor
|
Int2ShortConcurrentOpenHashMap(float loadFactor,
int concurrencyLevel)
Constructor that defines the load factor and concurrencyLevel
|
Int2ShortConcurrentOpenHashMap(int minCapacity)
Constructor that defines the minimum capacity
|
Int2ShortConcurrentOpenHashMap(int[] keys,
short[] values)
Helper constructor that allow to create a map from unboxed values
|
Int2ShortConcurrentOpenHashMap(int[] keys,
short[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
Int2ShortConcurrentOpenHashMap(int[] keys,
short[] values,
float loadFactor,
int concurrencyLevel)
Helper constructor that allow to create a map from unboxed values
|
Int2ShortConcurrentOpenHashMap(int[] keys,
short[] values,
int concurrencyLevel)
Helper constructor that allow to create a map from unboxed values
|
Int2ShortConcurrentOpenHashMap(Int2ShortMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ShortConcurrentOpenHashMap(Int2ShortMap map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ShortConcurrentOpenHashMap(Int2ShortMap map,
float loadFactor,
int concurrencyLevel)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ShortConcurrentOpenHashMap(Int2ShortMap map,
int concurrencyLevel)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ShortConcurrentOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ShortConcurrentOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ShortConcurrentOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] values,
float loadFactor,
int concurrencyLevel)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ShortConcurrentOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] values,
int concurrencyLevel)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ShortConcurrentOpenHashMap(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
Int2ShortConcurrentOpenHashMap(int minCapacity,
float loadFactor,
int concurrencyLevel)
Constructor that defines the minimum capacity, load factor and concurrencyLevel
|
Int2ShortConcurrentOpenHashMap(int minCapacity,
int concurrencyLevel)
Constructor that defines the minimum capacity and concurrencyLevel
|
Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map,
float loadFactor)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map,
float loadFactor,
int concurrencyLevel)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map,
int concurrencyLevel)
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(int key,
short value)
A Helper method to add a primitives together.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
short |
computeShort(int key,
IntShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfAbsent(int key,
Int2ShortFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfPresent(int key,
IntShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(int key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(short value)
Type Specific method to reduce boxing/unboxing of values
|
Int2ShortConcurrentOpenHashMap |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(IntShortConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
short |
get(int key)
A Type Specific get method to reduce boxing/unboxing
|
java.lang.Short |
get(java.lang.Object key) |
short |
getOrDefault(int key,
short defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<Int2ShortMap.Entry> |
int2ShortEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
boolean |
isEmpty() |
IntSet |
keySet() |
short |
mergeShort(int key,
short value,
ShortShortUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
short |
put(int key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
putIfAbsent(int key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int key,
short value)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
short |
removeOrDefault(int key,
short defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
short |
replace(int key,
short value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
short oldValue,
short newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
short |
subFrom(int key,
short value)
A Helper method to subtract from primitive from each other.
|
short |
supplyShortIfAbsent(int key,
ShortSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
ShortCollection |
values() |
addToAll, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, mergeAllShort, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceShorts, replaceShorts, setDefaultReturnValuecompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, replace, replace, replaceAlladdToAll, applyAsShort, builder, containsKey, containsValue, entrySet, getDefaultReturnValue, mergeAllShort, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceShorts, replaceShorts, setDefaultReturnValue, synchronize, synchronize, unmodifiableclearAndTrim, trimpublic Int2ShortConcurrentOpenHashMap()
public Int2ShortConcurrentOpenHashMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Int2ShortConcurrentOpenHashMap(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Int2ShortConcurrentOpenHashMap(int minCapacity,
int concurrencyLevel)
minCapacity - the minimum capacity the HashMap is allowed to be.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(float loadFactor,
int concurrencyLevel)
loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(int minCapacity,
float loadFactor,
int concurrencyLevel)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(java.lang.Integer[] 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 lenghtpublic Int2ShortConcurrentOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] 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 Int2ShortConcurrentOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] values,
int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] values,
float loadFactor,
int concurrencyLevel)
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 resizeconcurrencyLevel - decides how many operations can be performed at once.java.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 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(int[] 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 Int2ShortConcurrentOpenHashMap(int[] keys,
short[] 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 Int2ShortConcurrentOpenHashMap(int[] keys,
short[] values,
int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(int[] keys,
short[] values,
float loadFactor,
int concurrencyLevel)
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 resizeconcurrencyLevel - decides how many operations can be performed at once.java.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 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map)
map - the values that should be present in the mappublic Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> 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 Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map,
int concurrencyLevel)
map - the values that should be present in the mapconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map,
float loadFactor,
int concurrencyLevel)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(Int2ShortMap map)
map - the values that should be present in the mappublic Int2ShortConcurrentOpenHashMap(Int2ShortMap 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 Int2ShortConcurrentOpenHashMap(Int2ShortMap map, int concurrencyLevel)
map - the values that should be present in the mapconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Int2ShortConcurrentOpenHashMap(Int2ShortMap map, float loadFactor, int concurrencyLevel)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public short put(int key,
short value)
Int2ShortMapput in interface Int2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public short putIfAbsent(int key,
short value)
Int2ShortMapputIfAbsent in interface Int2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public short addTo(int key,
short value)
Int2ShortMapaddTo in interface Int2ShortMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic short subFrom(int key,
short value)
Int2ShortMapInt2ShortMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Int2ShortMapkey - that should be subtract fromvalue - that should be subtractpublic short remove(int key)
Int2ShortMapremove in interface Int2ShortMapkey - the element that should be removedpublic boolean remove(int key,
short value)
Int2ShortMapremove in interface Int2ShortMapkey - 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.concurrent.ConcurrentMap<java.lang.Integer,java.lang.Short>remove in interface java.util.Map<java.lang.Integer,java.lang.Short>remove in interface Int2ShortConcurrentMapremove in interface Int2ShortMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public short removeOrDefault(int key,
short defaultValue)
Int2ShortMapremoveOrDefault in interface Int2ShortMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public short get(int key)
Int2ShortMapget in interface Int2ShortMapkey - the key that is searched forpublic java.lang.Short get(java.lang.Object key)
get in interface java.util.Map<java.lang.Integer,java.lang.Short>get in interface Int2ShortMapget in class AbstractInt2ShortMappublic short getOrDefault(int key,
short defaultValue)
Int2ShortMapgetOrDefault in interface Int2ShortMapgetOrDefault in class AbstractInt2ShortMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic void forEach(IntShortConsumer action)
Int2ShortMapforEach in interface Int2ShortMapforEach in class AbstractInt2ShortMapaction - processor of the values that are iterator overpublic Int2ShortConcurrentOpenHashMap copy()
Int2ShortMapcopy in interface Int2ShortMapcopy in class AbstractInt2ShortMappublic boolean containsKey(int key)
Int2ShortMapcontainsKey in interface Int2ShortMapcontainsKey in class AbstractInt2ShortMapkey - element that is searched forpublic boolean containsValue(short value)
Int2ShortMapcontainsValue in interface Int2ShortMapcontainsValue in class AbstractInt2ShortMapvalue - element that is searched forpublic boolean replace(int key,
short oldValue,
short newValue)
Int2ShortMapreplace in interface Int2ShortMapreplace in class AbstractInt2ShortMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public short replace(int key,
short value)
Int2ShortMapreplace in interface Int2ShortMapreplace in class AbstractInt2ShortMapkey - the element that should be searched forvalue - the value to replace with.public short computeShort(int key,
IntShortUnaryOperator mappingFunction)
Int2ShortMapcomputeShort in interface Int2ShortMapcomputeShort in class AbstractInt2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic short computeShortIfAbsent(int key,
Int2ShortFunction mappingFunction)
Int2ShortMapcomputeShortIfAbsent in interface Int2ShortMapcomputeShortIfAbsent in class AbstractInt2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic short supplyShortIfAbsent(int key,
ShortSupplier valueProvider)
Int2ShortMapsupplyShortIfAbsent in interface Int2ShortMapsupplyShortIfAbsent in class AbstractInt2ShortMapkey - the key that should be computedvalueProvider - the value if not presentpublic short computeShortIfPresent(int key,
IntShortUnaryOperator mappingFunction)
Int2ShortMapcomputeShortIfPresent in interface Int2ShortMapcomputeShortIfPresent in class AbstractInt2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic short mergeShort(int key,
short value,
ShortShortUnaryOperator mappingFunction)
Int2ShortMapmergeShort in interface Int2ShortMapmergeShort in class AbstractInt2ShortMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void clear()
clear in interface java.util.Map<java.lang.Integer,java.lang.Short>clear in class java.util.AbstractMap<java.lang.Integer,java.lang.Short>public boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.Integer,java.lang.Short>isEmpty in class java.util.AbstractMap<java.lang.Integer,java.lang.Short>public int size()
size in interface java.util.Map<java.lang.Integer,java.lang.Short>size in class java.util.AbstractMap<java.lang.Integer,java.lang.Short>public ObjectSet<Int2ShortMap.Entry> int2ShortEntrySet()
Int2ShortMapint2ShortEntrySet in interface Int2ShortMappublic IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Short>keySet in interface Int2ShortMapkeySet in class AbstractInt2ShortMappublic ShortCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Short>values in interface Int2ShortMapvalues in class AbstractInt2ShortMap