T - the type of elements maintained by this Collectionpublic interface Object2FloatMap<T> extends java.util.Map<T,java.lang.Float>, Object2FloatFunction<T>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Object2FloatMap.BuilderCache<T>
Builder Cache for allowing to buildMaps
|
static interface |
Object2FloatMap.Entry<T>
Type Specific Map Entry that reduces boxing/unboxing
|
static interface |
Object2FloatMap.FastEntrySet<T>
Fast Entry set that allows for a faster Entry Iterator by recycling the Entry Object and just exchanging 1 internal value
|
static class |
Object2FloatMap.MapBuilder
Helper class that reduces the method spam of the Map Class.
|
| Modifier and Type | Method and Description |
|---|---|
float |
addTo(T key,
float value)
A Helper method to add a primitives together.
|
void |
addToAll(Object2FloatMap<T> m)
A Helper method to bulk add primitives together.
|
static Object2FloatMap.MapBuilder |
builder()
Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.
|
default java.lang.Float |
compute(T key,
java.util.function.BiFunction<? super T,? super java.lang.Float,? extends java.lang.Float> mappingFunction) |
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
|
default java.lang.Float |
computeIfAbsent(T key,
java.util.function.Function<? super T,? extends java.lang.Float> mappingFunction) |
default java.lang.Float |
computeIfPresent(T key,
java.util.function.BiFunction<? super T,? super java.lang.Float,? extends java.lang.Float> mappingFunction) |
boolean |
containsValue(float value)
Type Specific method to reduce boxing/unboxing of values
|
default boolean |
containsValue(java.lang.Object value) |
Object2FloatMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<T,java.lang.Float>> |
entrySet() |
default void |
forEach(java.util.function.BiConsumer<? super T,? super java.lang.Float> action) |
void |
forEach(ObjectFloatConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
default java.lang.Float |
get(java.lang.Object key) |
float |
getDefaultReturnValue()
Method to see what the default return value is.
|
float |
getFloat(T key)
A Type Specific get method to reduce boxing/unboxing
|
default java.lang.Float |
getOrDefault(java.lang.Object key,
java.lang.Float defaultValue) |
float |
getOrDefault(T key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<T> |
keySet() |
default java.lang.Float |
merge(T key,
java.lang.Float value,
java.util.function.BiFunction<? super java.lang.Float,? super java.lang.Float,? extends java.lang.Float> mappingFunction) |
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
|
default java.lang.Float |
put(T key,
java.lang.Float value) |
void |
putAll(Object2FloatMap<T> m)
Type Specific function for the bull putting of values
|
default void |
putAll(T[] keys,
float[] values)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
default void |
putAll(T[] keys,
java.lang.Float[] values)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(T[] keys,
float[] values,
int offset,
int size)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(T[] keys,
java.lang.Float[] values,
int offset,
int size)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAllIfAbsent(Object2FloatMap<T> m)
Type-Specific bulk put method put elements into the map if not present.
|
float |
putIfAbsent(T key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
default java.lang.Float |
putIfAbsent(T key,
java.lang.Float value) |
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.
|
default java.lang.Float |
remove(java.lang.Object key) |
default 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
|
default java.lang.Float |
replace(T key,
java.lang.Float value) |
boolean |
replace(T key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
default boolean |
replace(T key,
java.lang.Float oldValue,
java.lang.Float newValue) |
default void |
replaceAll(java.util.function.BiFunction<? super T,? super java.lang.Float,? extends java.lang.Float> mappingFunction) |
void |
replaceFloats(Object2FloatMap<T> m)
Type-Specific bulk replace method.
|
void |
replaceFloats(ObjectFloatUnaryOperator<T> mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
Object2FloatMap<T> |
setDefaultReturnValue(float v)
Method to define the default return value if a requested key isn't present
|
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
|
default Object2FloatMap<T> |
synchronize()
Creates a Wrapped Map that is Synchronized
|
default Object2FloatMap<T> |
synchronize(java.lang.Object mutex)
Creates a Wrapped Map that is Synchronized
|
default Object2FloatMap<T> |
unmodifiable()
Creates a Wrapped Map that is unmodifiable
|
FloatCollection |
values() |
static Object2FloatMap.MapBuilder builder()
float getDefaultReturnValue()
Object2FloatMap<T> setDefaultReturnValue(float v)
v - value that should be the default return valueObject2FloatMap<T> copy()
float put(T key, float value)
key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)default void putAll(T[] keys, float[] values)
keys - the keys that should be addedvalues - the values that should be addedjava.lang.IllegalStateException - if the arrays are not the same sizeMap.putAll(Map)void putAll(T[] keys, float[] values, int offset, int size)
keys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedjava.lang.IllegalStateException - if the arrays are not within the rangeMap.putAll(Map)default void putAll(T[] keys, java.lang.Float[] values)
keys - the keys that should be addedvalues - the values that should be addedjava.lang.IllegalStateException - if the arrays are not the same sizeMap.putAll(Map)void putAll(T[] keys, java.lang.Float[] values, int offset, int size)
keys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedjava.lang.IllegalStateException - if the arrays are not within the rangeMap.putAll(Map)float putIfAbsent(T key, float value)
key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)void putAllIfAbsent(Object2FloatMap<T> m)
m - elements that should be added if not present.float addTo(T key, float value)
key - the key that should be inserted,value - the value that should be inserted / addedvoid addToAll(Object2FloatMap<T> m)
m - the values that should be added/insertedfloat subFrom(T key, float value)
getDefaultReturnValue()
If the fence is reached the element will be automaticall removedkey - that should be subtract fromvalue - that should be subtractvoid putAll(Object2FloatMap<T> m)
m - the elements that should be insertedboolean containsValue(float value)
value - element that is searched fordefault boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<T,java.lang.Float>value - that is searched for.Map.containsValue(Object)float rem(T key)
key - the element that should be removeddefault java.lang.Float remove(java.lang.Object key)
remove in interface java.util.Map<T,java.lang.Float>key - the element that should be removedMap.remove(Object)boolean remove(T key, float value)
key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)default boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<T,java.lang.Float>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)float remOrDefault(T key, float defaultValue)
key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)boolean replace(T key, float oldValue, float newValue)
key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.float replace(T key, float value)
key - the element that should be searched forvalue - the value to replace with.void replaceFloats(Object2FloatMap<T> m)
m - elements that should be replaced.void replaceFloats(ObjectFloatUnaryOperator<T> mappingFunction)
mappingFunction - operation to replace all valuesfloat computeFloat(T key, ObjectFloatUnaryOperator<T> mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the valuefloat computeFloatIfAbsent(T key, Object2FloatFunction<T> mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if not presentfloat supplyFloatIfAbsent(T key, FloatSupplier valueProvider)
key - the key that should be computedvalueProvider - the value if not presentfloat computeFloatIfPresent(T key, ObjectFloatUnaryOperator<T> mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if presentfloat mergeFloat(T key, float value, FloatFloatUnaryOperator mappingFunction)
key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuevoid mergeAllFloat(Object2FloatMap<T> m, FloatFloatUnaryOperator mappingFunction)
m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuedefault boolean replace(T key, java.lang.Float oldValue, java.lang.Float newValue)
replace in interface java.util.Map<T,java.lang.Float>default java.lang.Float replace(T key, java.lang.Float value)
replace in interface java.util.Map<T,java.lang.Float>float getFloat(T key)
getFloat in interface Object2FloatFunction<T>key - the key that is searched forfloat getOrDefault(T key, float defaultValue)
key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentdefault java.lang.Float get(java.lang.Object key)
get in interface java.util.Map<T,java.lang.Float>default java.lang.Float getOrDefault(java.lang.Object key,
java.lang.Float defaultValue)
getOrDefault in interface java.util.Map<T,java.lang.Float>default void replaceAll(java.util.function.BiFunction<? super T,? super java.lang.Float,? extends java.lang.Float> mappingFunction)
replaceAll in interface java.util.Map<T,java.lang.Float>default java.lang.Float compute(T key, java.util.function.BiFunction<? super T,? super java.lang.Float,? extends java.lang.Float> mappingFunction)
compute in interface java.util.Map<T,java.lang.Float>default java.lang.Float computeIfAbsent(T key, java.util.function.Function<? super T,? extends java.lang.Float> mappingFunction)
computeIfAbsent in interface java.util.Map<T,java.lang.Float>default java.lang.Float computeIfPresent(T key, java.util.function.BiFunction<? super T,? super java.lang.Float,? extends java.lang.Float> mappingFunction)
computeIfPresent in interface java.util.Map<T,java.lang.Float>default java.lang.Float merge(T key, java.lang.Float value, java.util.function.BiFunction<? super java.lang.Float,? super java.lang.Float,? extends java.lang.Float> mappingFunction)
merge in interface java.util.Map<T,java.lang.Float>void forEach(ObjectFloatConsumer<T> action)
action - processor of the values that are iterator overdefault void forEach(java.util.function.BiConsumer<? super T,? super java.lang.Float> action)
forEach in interface java.util.Map<T,java.lang.Float>FloatCollection values()
values in interface java.util.Map<T,java.lang.Float>ObjectSet<java.util.Map.Entry<T,java.lang.Float>> entrySet()
entrySet in interface java.util.Map<T,java.lang.Float>ObjectSet<Object2FloatMap.Entry<T>> object2FloatEntrySet()
default Object2FloatMap<T> synchronize()
Object2FloatMaps.synchronize(speiger.src.collections.objects.maps.interfaces.Object2FloatMap<T>)default Object2FloatMap<T> synchronize(java.lang.Object mutex)
mutex - is the controller of the synchronization blockObject2FloatMaps.synchronize(speiger.src.collections.objects.maps.interfaces.Object2FloatMap<T>)default Object2FloatMap<T> unmodifiable()
Object2FloatMaps.unmodifiable(speiger.src.collections.objects.maps.interfaces.Object2FloatMap<T>)default java.lang.Float put(T key, java.lang.Float value)
put in interface java.util.Map<T,java.lang.Float>