T - the type of elements maintained by this Collectionpublic class ImmutableObject2FloatOpenHashMap<T> extends AbstractObject2FloatMap<T> implements Object2FloatOrderedMap<T>
AbstractObject2FloatMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2FloatOrderedMap.FastOrderedSet<T>Object2FloatMap.BuilderCache<T>, Object2FloatMap.Entry<T>, Object2FloatMap.FastEntrySet<T>, Object2FloatMap.MapBuilder| Constructor and Description |
|---|
ImmutableObject2FloatOpenHashMap(java.util.Map<? extends T,? extends java.lang.Float> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
ImmutableObject2FloatOpenHashMap(java.util.Map<? extends T,? 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.
|
ImmutableObject2FloatOpenHashMap(Object2FloatMap<T> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
ImmutableObject2FloatOpenHashMap(Object2FloatMap<T> map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
ImmutableObject2FloatOpenHashMap(T[] keys,
float[] values)
Helper constructor that allow to create a map from unboxed values
|
ImmutableObject2FloatOpenHashMap(T[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
ImmutableObject2FloatOpenHashMap(T[] keys,
float[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
ImmutableObject2FloatOpenHashMap(T[] keys,
java.lang.Float[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
| Modifier and Type | Method and Description |
|---|---|
float |
addTo(T key,
float value)
A Helper method to add a primitives together.
|
void |
clear() |
float |
computeFloat(T key,
ObjectFloatUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfAbsent(T key,
Object2FloatFunction<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfPresent(T key,
ObjectFloatUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(float value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
ImmutableObject2FloatOpenHashMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
float |
firstFloatValue()
A method to get the first Value of a Map.
|
T |
firstKey()
A method to get the first Key of a Map.
|
void |
forEach(ObjectFloatConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Float |
get(java.lang.Object key) |
float |
getAndMoveToFirst(T key)
A Specific get method that allows to move teh given key/value int the first index.
|
float |
getAndMoveToLast(T key)
A Specific get method that allows to move teh given key/value int the last index.
|
float |
getFloat(T key)
A Type Specific get method to reduce boxing/unboxing
|
float |
getOrDefault(T key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectOrderedSet<T> |
keySet() |
float |
lastFloatValue()
A method to get the last Value of a Map.
|
T |
lastKey()
A method to get the last Key of a Map.
|
void |
mergeAllFloat(Object2FloatMap<T> m,
FloatFloatUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
float |
mergeFloat(T key,
float value,
FloatFloatUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(T key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(T key)
A specific move method to move a given key/value to the last index.
|
ObjectOrderedSet<Object2FloatMap.Entry<T>> |
object2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
T |
pollFirstKey()
A method to get and remove the first Key of a Map.
|
T |
pollLastKey()
A method to get and remove the last Key of a Map.
|
float |
put(T key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putAndMoveToFirst(T key,
float value)
A customized put method that allows you to insert into the first index.
|
float |
putAndMoveToLast(T key,
float value)
A customized put method that allows you to insert into the last index.
|
float |
putIfAbsent(T key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
float |
remOrDefault(T key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
java.lang.Float |
remove(java.lang.Object key)
Deprecated.
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
boolean |
remove(T key,
float value)
Type Specific remove function to reduce boxing/unboxing
|
float |
replace(T key,
float value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
float |
subFrom(T key,
float value)
A Helper method to subtract from primitive from each other.
|
float |
supplyFloatIfAbsent(T 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, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceFloats, replaceFloats, setDefaultReturnValuepublic ImmutableObject2FloatOpenHashMap(T[] 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 ImmutableObject2FloatOpenHashMap(T[] 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 ImmutableObject2FloatOpenHashMap(T[] 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 ImmutableObject2FloatOpenHashMap(T[] 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 ImmutableObject2FloatOpenHashMap(java.util.Map<? extends T,? extends java.lang.Float> map)
map - the values that should be present in the mappublic ImmutableObject2FloatOpenHashMap(java.util.Map<? extends T,? 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 ImmutableObject2FloatOpenHashMap(Object2FloatMap<T> map)
map - the values that should be present in the mappublic ImmutableObject2FloatOpenHashMap(Object2FloatMap<T> 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(T key, float value)
Object2FloatMapput in interface Object2FloatMap<T>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(T key, float value)
Object2FloatMapputIfAbsent in interface Object2FloatMap<T>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(T key, float value)
Object2FloatMapaddTo in interface Object2FloatMap<T>key - the key that should be inserted,value - the value that should be inserted / addedpublic float subFrom(T key, float value)
Object2FloatMapObject2FloatMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Object2FloatMap<T>key - that should be subtract fromvalue - that should be subtractpublic float putAndMoveToFirst(T key, float value)
Object2FloatOrderedMapputAndMoveToFirst in interface Object2FloatOrderedMap<T>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public float putAndMoveToLast(T key, float value)
Object2FloatOrderedMapputAndMoveToLast in interface Object2FloatOrderedMap<T>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(T key)
Object2FloatOrderedMapmoveToFirst in interface Object2FloatOrderedMap<T>key - that should be moved to the first indexpublic boolean moveToLast(T key)
Object2FloatOrderedMapmoveToLast in interface Object2FloatOrderedMap<T>key - that should be moved to the first lastpublic float getAndMoveToFirst(T key)
Object2FloatOrderedMapgetAndMoveToFirst in interface Object2FloatOrderedMap<T>key - that is searched forpublic float getAndMoveToLast(T key)
Object2FloatOrderedMapgetAndMoveToLast in interface Object2FloatOrderedMap<T>key - that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,java.lang.Float>containsKey in class AbstractObject2FloatMap<T>public boolean containsValue(float value)
Object2FloatMapcontainsValue in interface Object2FloatMap<T>containsValue in class AbstractObject2FloatMap<T>value - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<T,java.lang.Float>containsValue in interface Object2FloatMap<T>containsValue in class java.util.AbstractMap<T,java.lang.Float>value - that is searched for.Map.containsValue(Object)public float rem(T key)
Object2FloatMaprem in interface Object2FloatMap<T>key - the element that should be removedpublic float remOrDefault(T key, float defaultValue)
Object2FloatMapremOrDefault in interface Object2FloatMap<T>key - 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<T,java.lang.Float>remove in interface Object2FloatMap<T>remove in class AbstractObject2FloatMap<T>key - the element that should be removedMap.remove(Object)public boolean remove(T key, float value)
Object2FloatMapremove in interface Object2FloatMap<T>key - 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<T,java.lang.Float>remove in interface Object2FloatMap<T>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public float getFloat(T key)
Object2FloatMapgetFloat in interface Object2FloatFunction<T>getFloat in interface Object2FloatMap<T>key - the key that is searched forpublic java.lang.Float get(java.lang.Object key)
get in interface java.util.Map<T,java.lang.Float>get in interface Object2FloatMap<T>get in class AbstractObject2FloatMap<T>public float getOrDefault(T key, float defaultValue)
Object2FloatMapgetOrDefault in interface Object2FloatMap<T>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic T firstKey()
Object2FloatOrderedMapfirstKey in interface Object2FloatOrderedMap<T>public T pollFirstKey()
Object2FloatOrderedMappollFirstKey in interface Object2FloatOrderedMap<T>public T lastKey()
Object2FloatOrderedMaplastKey in interface Object2FloatOrderedMap<T>public T pollLastKey()
Object2FloatOrderedMappollLastKey in interface Object2FloatOrderedMap<T>public float firstFloatValue()
Object2FloatOrderedMapfirstFloatValue in interface Object2FloatOrderedMap<T>public float lastFloatValue()
Object2FloatOrderedMaplastFloatValue in interface Object2FloatOrderedMap<T>public ObjectOrderedSet<Object2FloatMap.Entry<T>> object2FloatEntrySet()
Object2FloatMapobject2FloatEntrySet in interface Object2FloatMap<T>object2FloatEntrySet in interface Object2FloatOrderedMap<T>public ObjectOrderedSet<T> keySet()
keySet in interface java.util.Map<T,java.lang.Float>keySet in interface Object2FloatMap<T>keySet in interface Object2FloatOrderedMap<T>keySet in class AbstractObject2FloatMap<T>public FloatCollection values()
values in interface java.util.Map<T,java.lang.Float>values in interface Object2FloatMap<T>values in class AbstractObject2FloatMap<T>public ImmutableObject2FloatOpenHashMap<T> copy()
Object2FloatMapcopy in interface Object2FloatMap<T>copy in interface Object2FloatOrderedMap<T>copy in class AbstractObject2FloatMap<T>public void forEach(ObjectFloatConsumer<T> action)
Object2FloatMapforEach in interface Object2FloatMap<T>forEach in class AbstractObject2FloatMap<T>action - processor of the values that are iterator overpublic boolean replace(T key, float oldValue, float newValue)
Object2FloatMapreplace in interface Object2FloatMap<T>replace in class AbstractObject2FloatMap<T>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public float replace(T key, float value)
Object2FloatMapreplace in interface Object2FloatMap<T>replace in class AbstractObject2FloatMap<T>key - the element that should be searched forvalue - the value to replace with.public float computeFloat(T key, ObjectFloatUnaryOperator<T> mappingFunction)
Object2FloatMapcomputeFloat in interface Object2FloatMap<T>computeFloat in class AbstractObject2FloatMap<T>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic float computeFloatIfAbsent(T key, Object2FloatFunction<T> mappingFunction)
Object2FloatMapcomputeFloatIfAbsent in interface Object2FloatMap<T>computeFloatIfAbsent in class AbstractObject2FloatMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic float supplyFloatIfAbsent(T key, FloatSupplier valueProvider)
Object2FloatMapsupplyFloatIfAbsent in interface Object2FloatMap<T>supplyFloatIfAbsent in class AbstractObject2FloatMap<T>key - the key that should be computedvalueProvider - the value if not presentpublic float computeFloatIfPresent(T key, ObjectFloatUnaryOperator<T> mappingFunction)
Object2FloatMapcomputeFloatIfPresent in interface Object2FloatMap<T>computeFloatIfPresent in class AbstractObject2FloatMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic float mergeFloat(T key, float value, FloatFloatUnaryOperator mappingFunction)
Object2FloatMapmergeFloat in interface Object2FloatMap<T>mergeFloat in class AbstractObject2FloatMap<T>key - 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(Object2FloatMap<T> m, FloatFloatUnaryOperator mappingFunction)
Object2FloatMapmergeAllFloat in interface Object2FloatMap<T>mergeAllFloat in class AbstractObject2FloatMap<T>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()