public class ImmutableShort2FloatOpenHashMap extends AbstractShort2FloatMap implements Short2FloatOrderedMap
AbstractShort2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Short2FloatOrderedMap.FastOrderedSetShort2FloatMap.BuilderCache, Short2FloatMap.Entry, Short2FloatMap.FastEntrySet, Short2FloatMap.MapBuilder| Constructor and Description |
|---|
ImmutableShort2FloatOpenHashMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Float> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
ImmutableShort2FloatOpenHashMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Float> map,
float loadFactor)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
ImmutableShort2FloatOpenHashMap(short[] keys,
float[] values)
Helper constructor that allow to create a map from unboxed values
|
ImmutableShort2FloatOpenHashMap(java.lang.Short[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
ImmutableShort2FloatOpenHashMap(short[] keys,
float[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
ImmutableShort2FloatOpenHashMap(java.lang.Short[] keys,
java.lang.Float[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
ImmutableShort2FloatOpenHashMap(Short2FloatMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
ImmutableShort2FloatOpenHashMap(Short2FloatMap map,
float loadFactor)
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 |
|---|---|
float |
addTo(short key,
float value)
A Helper method to add a primitives together.
|
void |
clear() |
float |
computeFloat(short key,
ShortFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfAbsent(short key,
Short2FloatFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfPresent(short key,
ShortFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key)
Deprecated.
|
boolean |
containsKey(short key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(float value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
ImmutableShort2FloatOpenHashMap |
copy()
A Function that does a shallow clone of the Map itself.
|
float |
firstFloatValue()
A method to get the first Value of a Map.
|
short |
firstShortKey()
A method to get the first Key of a Map.
|
void |
forEach(ShortFloatConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Float |
get(java.lang.Object key) |
float |
get(short key)
A Type Specific get method to reduce boxing/unboxing
|
float |
getAndMoveToFirst(short key)
A Specific get method that allows to move teh given key/value int the first index.
|
float |
getAndMoveToLast(short key)
A Specific get method that allows to move teh given key/value int the last index.
|
float |
getOrDefault(short key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ShortOrderedSet |
keySet() |
float |
lastFloatValue()
A method to get the last Value of a Map.
|
short |
lastShortKey()
A method to get the last Key of a Map.
|
void |
mergeAllFloat(Short2FloatMap m,
FloatFloatUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
float |
mergeFloat(short key,
float value,
FloatFloatUnaryOperator 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.
|
float |
put(short key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putAndMoveToFirst(short key,
float value)
A customized put method that allows you to insert into the first index.
|
float |
putAndMoveToLast(short key,
float value)
A customized put method that allows you to insert into the last index.
|
float |
putIfAbsent(short key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
java.lang.Float |
remove(java.lang.Object key)
Deprecated.
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
float |
remove(short key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(short key,
float value)
Type Specific remove function to reduce boxing/unboxing
|
float |
removeOrDefault(short key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
float |
replace(short key,
float value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(short key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
ObjectOrderedSet<Short2FloatMap.Entry> |
short2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
int |
size() |
float |
subFrom(short key,
float value)
A Helper method to subtract from primitive from each other.
|
float |
supplyFloatIfAbsent(short key,
FloatSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
FloatCollection |
values() |
addToAll, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceFloats, replaceFloats, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, applyAsFloat, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceFloats, replaceFloats, setDefaultReturnValuepublic ImmutableShort2FloatOpenHashMap(java.lang.Short[] keys,
java.lang.Float[] 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 ImmutableShort2FloatOpenHashMap(java.lang.Short[] keys,
java.lang.Float[] 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 ImmutableShort2FloatOpenHashMap(short[] keys,
float[] 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 ImmutableShort2FloatOpenHashMap(short[] keys,
float[] 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 ImmutableShort2FloatOpenHashMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Float> map)
map - the values that should be present in the mappublic ImmutableShort2FloatOpenHashMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Float> 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 ImmutableShort2FloatOpenHashMap(Short2FloatMap map)
map - the values that should be present in the mappublic ImmutableShort2FloatOpenHashMap(Short2FloatMap 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 float put(short key,
float value)
Short2FloatMapput in interface Short2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(short key,
float value)
Short2FloatMapputIfAbsent in interface Short2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(short key,
float value)
Short2FloatMapaddTo in interface Short2FloatMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic float subFrom(short key,
float value)
Short2FloatMapShort2FloatMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Short2FloatMapkey - that should be subtract fromvalue - that should be subtractpublic float putAndMoveToFirst(short key,
float value)
Short2FloatOrderedMapputAndMoveToFirst in interface Short2FloatOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public float putAndMoveToLast(short key,
float value)
Short2FloatOrderedMapputAndMoveToLast in interface Short2FloatOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(short key)
Short2FloatOrderedMapmoveToFirst in interface Short2FloatOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(short key)
Short2FloatOrderedMapmoveToLast in interface Short2FloatOrderedMapkey - that should be moved to the first lastpublic float getAndMoveToFirst(short key)
Short2FloatOrderedMapgetAndMoveToFirst in interface Short2FloatOrderedMapkey - that is searched forpublic float getAndMoveToLast(short key)
Short2FloatOrderedMapgetAndMoveToLast in interface Short2FloatOrderedMapkey - that is searched forpublic boolean containsKey(short key)
Short2FloatMapcontainsKey in interface Short2FloatMapcontainsKey in class AbstractShort2FloatMapkey - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Short,java.lang.Float>containsKey in interface Short2FloatMapcontainsKey in class java.util.AbstractMap<java.lang.Short,java.lang.Float>key - that is searched for.Map.containsKey(Object)public boolean containsValue(float value)
Short2FloatMapcontainsValue in interface Short2FloatMapcontainsValue in class AbstractShort2FloatMapvalue - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Short,java.lang.Float>containsValue in interface Short2FloatMapcontainsValue in class java.util.AbstractMap<java.lang.Short,java.lang.Float>value - that is searched for.Map.containsValue(Object)public float remove(short key)
Short2FloatMapremove in interface Short2FloatMapkey - the element that should be removedpublic float removeOrDefault(short key,
float defaultValue)
Short2FloatMapremoveOrDefault in interface Short2FloatMapkey - 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.Float remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Short,java.lang.Float>remove in interface Short2FloatMapremove in class AbstractShort2FloatMapkey - the element that should be removedMap.remove(Object)public boolean remove(short key,
float value)
Short2FloatMapremove in interface Short2FloatMapkey - 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.Short,java.lang.Float>remove in interface Short2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public float get(short key)
Short2FloatMapget in interface Short2FloatMapkey - the key that is searched forpublic java.lang.Float get(java.lang.Object key)
get in interface java.util.Map<java.lang.Short,java.lang.Float>get in interface Short2FloatMapget in class AbstractShort2FloatMappublic float getOrDefault(short key,
float defaultValue)
Short2FloatMapgetOrDefault in interface Short2FloatMapgetOrDefault in class AbstractShort2FloatMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic short firstShortKey()
Short2FloatOrderedMapfirstShortKey in interface Short2FloatOrderedMappublic short pollFirstShortKey()
Short2FloatOrderedMappollFirstShortKey in interface Short2FloatOrderedMappublic short lastShortKey()
Short2FloatOrderedMaplastShortKey in interface Short2FloatOrderedMappublic short pollLastShortKey()
Short2FloatOrderedMappollLastShortKey in interface Short2FloatOrderedMappublic float firstFloatValue()
Short2FloatOrderedMapfirstFloatValue in interface Short2FloatOrderedMappublic float lastFloatValue()
Short2FloatOrderedMaplastFloatValue in interface Short2FloatOrderedMappublic ObjectOrderedSet<Short2FloatMap.Entry> short2FloatEntrySet()
Short2FloatMapshort2FloatEntrySet in interface Short2FloatMapshort2FloatEntrySet in interface Short2FloatOrderedMappublic ShortOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Short,java.lang.Float>keySet in interface Short2FloatMapkeySet in interface Short2FloatOrderedMapkeySet in class AbstractShort2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Short,java.lang.Float>values in interface Short2FloatMapvalues in class AbstractShort2FloatMappublic ImmutableShort2FloatOpenHashMap copy()
Short2FloatMapcopy in interface Short2FloatMapcopy in interface Short2FloatOrderedMapcopy in class AbstractShort2FloatMappublic void forEach(ShortFloatConsumer action)
Short2FloatMapforEach in interface Short2FloatMapforEach in class AbstractShort2FloatMapaction - processor of the values that are iterator overpublic boolean replace(short key,
float oldValue,
float newValue)
Short2FloatMapreplace in interface Short2FloatMapreplace in class AbstractShort2FloatMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public float replace(short key,
float value)
Short2FloatMapreplace in interface Short2FloatMapreplace in class AbstractShort2FloatMapkey - the element that should be searched forvalue - the value to replace with.public float computeFloat(short key,
ShortFloatUnaryOperator mappingFunction)
Short2FloatMapcomputeFloat in interface Short2FloatMapcomputeFloat in class AbstractShort2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic float computeFloatIfAbsent(short key,
Short2FloatFunction mappingFunction)
Short2FloatMapcomputeFloatIfAbsent in interface Short2FloatMapcomputeFloatIfAbsent in class AbstractShort2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic float supplyFloatIfAbsent(short key,
FloatSupplier valueProvider)
Short2FloatMapsupplyFloatIfAbsent in interface Short2FloatMapsupplyFloatIfAbsent in class AbstractShort2FloatMapkey - the key that should be computedvalueProvider - the value if not presentpublic float computeFloatIfPresent(short key,
ShortFloatUnaryOperator mappingFunction)
Short2FloatMapcomputeFloatIfPresent in interface Short2FloatMapcomputeFloatIfPresent in class AbstractShort2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic float mergeFloat(short key,
float value,
FloatFloatUnaryOperator mappingFunction)
Short2FloatMapmergeFloat in interface Short2FloatMapmergeFloat in class AbstractShort2FloatMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllFloat(Short2FloatMap m, FloatFloatUnaryOperator mappingFunction)
Short2FloatMapmergeAllFloat in interface Short2FloatMapmergeAllFloat in class AbstractShort2FloatMapm - 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.Float>size in class java.util.AbstractMap<java.lang.Short,java.lang.Float>public void clear()
clear in interface java.util.Map<java.lang.Short,java.lang.Float>clear in class java.util.AbstractMap<java.lang.Short,java.lang.Float>