public class ImmutableInt2ShortOpenHashMap extends AbstractInt2ShortMap implements Int2ShortOrderedMap
AbstractInt2ShortMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2ShortOrderedMap.FastOrderedSetInt2ShortMap.BuilderCache, Int2ShortMap.Entry, Int2ShortMap.FastEntrySet, Int2ShortMap.MapBuilder| Constructor and Description |
|---|
ImmutableInt2ShortOpenHashMap(int[] keys,
short[] values)
Helper constructor that allow to create a map from unboxed values
|
ImmutableInt2ShortOpenHashMap(int[] keys,
short[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
ImmutableInt2ShortOpenHashMap(Int2ShortMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
ImmutableInt2ShortOpenHashMap(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.
|
ImmutableInt2ShortOpenHashMap(java.lang.Integer[] keys,
java.lang.Short[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
ImmutableInt2ShortOpenHashMap(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)
|
ImmutableInt2ShortOpenHashMap(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.
|
ImmutableInt2ShortOpenHashMap(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.
|
| Modifier and Type | Method and Description |
|---|---|
short |
addTo(int key,
short value)
A Helper method to add a primitives together.
|
void |
clear() |
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 |
containsKey(java.lang.Object key)
Deprecated.
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
boolean |
containsValue(short value)
Type Specific method to reduce boxing/unboxing of values
|
ImmutableInt2ShortOpenHashMap |
copy()
A Function that does a shallow clone of the Map itself.
|
int |
firstIntKey()
A method to get the first Key of a Map.
|
short |
firstShortValue()
A method to get the first Value of a Map.
|
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 |
getAndMoveToFirst(int key)
A Specific get method that allows to move teh given key/value int the first index.
|
short |
getAndMoveToLast(int key)
A Specific get method that allows to move teh given key/value int the last index.
|
short |
getOrDefault(int key,
short defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectOrderedSet<Int2ShortMap.Entry> |
int2ShortEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntOrderedSet |
keySet() |
int |
lastIntKey()
A method to get the last Key of a Map.
|
short |
lastShortValue()
A method to get the last Value of a Map.
|
void |
mergeAllShort(Int2ShortMap m,
ShortShortUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
short |
mergeShort(int key,
short value,
ShortShortUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(int key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(int key)
A specific move method to move a given key/value to the last index.
|
int |
pollFirstIntKey()
A method to get and remove the first Key of a Map.
|
int |
pollLastIntKey()
A method to get and remove the last Key of a Map.
|
short |
put(int key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
putAndMoveToFirst(int key,
short value)
A customized put method that allows you to insert into the first index.
|
short |
putAndMoveToLast(int key,
short value)
A customized put method that allows you to insert into the last index.
|
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
|
java.lang.Short |
remove(java.lang.Object key)
Deprecated.
|
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
|
ShortCollection |
values() |
addToAll, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceShorts, replaceShorts, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceShorts, replaceShorts, setDefaultReturnValuepublic ImmutableInt2ShortOpenHashMap(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 ImmutableInt2ShortOpenHashMap(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 ImmutableInt2ShortOpenHashMap(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 ImmutableInt2ShortOpenHashMap(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 ImmutableInt2ShortOpenHashMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Short> map)
map - the values that should be present in the mappublic ImmutableInt2ShortOpenHashMap(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 ImmutableInt2ShortOpenHashMap(Int2ShortMap map)
map - the values that should be present in the mappublic ImmutableInt2ShortOpenHashMap(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 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 putAndMoveToFirst(int key,
short value)
Int2ShortOrderedMapputAndMoveToFirst in interface Int2ShortOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public short putAndMoveToLast(int key,
short value)
Int2ShortOrderedMapputAndMoveToLast in interface Int2ShortOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(int key)
Int2ShortOrderedMapmoveToFirst in interface Int2ShortOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(int key)
Int2ShortOrderedMapmoveToLast in interface Int2ShortOrderedMapkey - that should be moved to the first lastpublic short getAndMoveToFirst(int key)
Int2ShortOrderedMapgetAndMoveToFirst in interface Int2ShortOrderedMapkey - that is searched forpublic short getAndMoveToLast(int key)
Int2ShortOrderedMapgetAndMoveToLast in interface Int2ShortOrderedMapkey - that is searched forpublic boolean containsKey(int key)
Int2ShortMapcontainsKey in interface Int2ShortMapcontainsKey in class AbstractInt2ShortMapkey - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Integer,java.lang.Short>containsKey in interface Int2ShortMapcontainsKey in class java.util.AbstractMap<java.lang.Integer,java.lang.Short>key - that is searched for.Map.containsKey(Object)public boolean containsValue(short value)
Int2ShortMapcontainsValue in interface Int2ShortMapcontainsValue in class AbstractInt2ShortMapvalue - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Integer,java.lang.Short>containsValue in interface Int2ShortMapcontainsValue in class java.util.AbstractMap<java.lang.Integer,java.lang.Short>value - that is searched for.Map.containsValue(Object)public short remove(int key)
Int2ShortMapremove in interface Int2ShortMapkey - the element that should be removedpublic 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)@Deprecated public java.lang.Short remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,java.lang.Short>remove in interface Int2ShortMapremove in class AbstractInt2ShortMapkey - the element that should be removedMap.remove(Object)public 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.Map<java.lang.Integer,java.lang.Short>remove in interface Int2ShortMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public short get(int key)
Int2ShortMapget in interface Int2ShortFunctionget 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 int firstIntKey()
Int2ShortOrderedMapfirstIntKey in interface Int2ShortOrderedMappublic int pollFirstIntKey()
Int2ShortOrderedMappollFirstIntKey in interface Int2ShortOrderedMappublic int lastIntKey()
Int2ShortOrderedMaplastIntKey in interface Int2ShortOrderedMappublic int pollLastIntKey()
Int2ShortOrderedMappollLastIntKey in interface Int2ShortOrderedMappublic short firstShortValue()
Int2ShortOrderedMapfirstShortValue in interface Int2ShortOrderedMappublic short lastShortValue()
Int2ShortOrderedMaplastShortValue in interface Int2ShortOrderedMappublic ObjectOrderedSet<Int2ShortMap.Entry> int2ShortEntrySet()
Int2ShortMapint2ShortEntrySet in interface Int2ShortMapint2ShortEntrySet in interface Int2ShortOrderedMappublic IntOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Short>keySet in interface Int2ShortMapkeySet in interface Int2ShortOrderedMapkeySet in class AbstractInt2ShortMappublic ShortCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Short>values in interface Int2ShortMapvalues in class AbstractInt2ShortMappublic ImmutableInt2ShortOpenHashMap copy()
Int2ShortMapcopy in interface Int2ShortMapcopy in interface Int2ShortOrderedMapcopy in class AbstractInt2ShortMappublic void forEach(IntShortConsumer action)
Int2ShortMapforEach in interface Int2ShortMapforEach in class AbstractInt2ShortMapaction - processor of the values that are iterator overpublic 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 mergeAllShort(Int2ShortMap m, ShortShortUnaryOperator mappingFunction)
Int2ShortMapmergeAllShort in interface Int2ShortMapmergeAllShort in class AbstractInt2ShortMapm - 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.Integer,java.lang.Short>size in class java.util.AbstractMap<java.lang.Integer,java.lang.Short>public 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>