T - the type of elements maintained by this Collectionpublic class Enum2FloatMap<T extends java.lang.Enum<T>> extends AbstractObject2FloatMap<T>
AbstractObject2FloatMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2FloatMap.BuilderCache<T>, Object2FloatMap.Entry<T>, Object2FloatMap.FastEntrySet<T>, Object2FloatMap.MapBuilder| Constructor and Description |
|---|
Enum2FloatMap(java.lang.Class<T> keyType)
Default Constructor
|
Enum2FloatMap(java.util.Map<? extends T,? extends java.lang.Float> map)
A Helper constructor that allows to create a EnumMap with exactly the same values as the provided map.
|
Enum2FloatMap(Object2FloatMap<T> map)
A Type Specific Helper function that allows to create a new EnumMap with exactly the same values as the provided map.
|
Enum2FloatMap(T[] keys,
float[] values)
Helper constructor that allow to create a EnumMap from unboxed values
|
Enum2FloatMap(T[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a EnumMap 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
|
Enum2FloatMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(ObjectFloatConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
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
|
ObjectSet<T> |
keySet() |
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
|
ObjectSet<Object2FloatMap.Entry<T>> |
object2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
float |
put(T key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
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) |
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, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceFloats, replaceFloats, setDefaultReturnValuebuilder, compute, computeIfAbsent, computeIfPresent, containsValue, forEach, merge, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic Enum2FloatMap(java.lang.Class<T> keyType)
keyType - the type of Enum that should be usedpublic Enum2FloatMap(T[] keys, java.lang.Float[] values)
keys - the keys that should be put into the EnumMapvalues - the values that should be put into the EnumMap.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Enum2FloatMap(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 Enum2FloatMap(java.util.Map<? extends T,? extends java.lang.Float> map)
map - the values that should be present in the mappublic Enum2FloatMap(Object2FloatMap<T> map)
map - the values that should be present in the mappublic float put(T key, float value)
Object2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(T key, float value)
Object2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(T key, float value)
Object2FloatMapkey - 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 removedkey - that should be subtract fromvalue - that should be subtractpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Float>containsKey in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>public boolean containsValue(float value)
Object2FloatMapcontainsValue in interface Object2FloatMap<T extends java.lang.Enum<T>>containsValue in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>value - element that is searched forpublic java.lang.Float remove(java.lang.Object key)
remove in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Float>remove in interface Object2FloatMap<T extends java.lang.Enum<T>>remove in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>key - the element that should be removedMap.remove(Object)public float rem(T key)
Object2FloatMapkey - the element that should be removedpublic float remOrDefault(T key, float defaultValue)
Object2FloatMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(T key, float value)
Object2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public float getFloat(T key)
Object2FloatMapkey - the key that is searched forpublic float getOrDefault(T key, float defaultValue)
Object2FloatMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Enum2FloatMap<T> copy()
Object2FloatMapcopy in interface Object2FloatMap<T extends java.lang.Enum<T>>copy in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>public ObjectSet<Object2FloatMap.Entry<T>> object2FloatEntrySet()
Object2FloatMappublic ObjectSet<T> keySet()
keySet in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Float>keySet in interface Object2FloatMap<T extends java.lang.Enum<T>>keySet in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>public FloatCollection values()
values in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Float>values in interface Object2FloatMap<T extends java.lang.Enum<T>>values in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>public void forEach(ObjectFloatConsumer<T> action)
Object2FloatMapforEach in interface Object2FloatMap<T extends java.lang.Enum<T>>forEach in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>action - processor of the values that are iterator overpublic boolean replace(T key, float oldValue, float newValue)
Object2FloatMapreplace in interface Object2FloatMap<T extends java.lang.Enum<T>>replace in class AbstractObject2FloatMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>replace in class AbstractObject2FloatMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>computeFloat in class AbstractObject2FloatMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>computeFloatIfAbsent in class AbstractObject2FloatMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>supplyFloatIfAbsent in class AbstractObject2FloatMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>computeFloatIfPresent in class AbstractObject2FloatMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>mergeFloat in class AbstractObject2FloatMap<T extends java.lang.Enum<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 extends java.lang.Enum<T>>mergeAllFloat in class AbstractObject2FloatMap<T extends java.lang.Enum<T>>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void clear()