T - the type of elements maintained by this Collectionpublic class Object2FloatConcurrentOpenHashMap<T> extends AbstractObject2FloatMap<T> implements Object2FloatConcurrentMap<T>, ITrimmable
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 |
|---|
Object2FloatConcurrentOpenHashMap()
Default Constructor
|
Object2FloatConcurrentOpenHashMap(float loadFactor,
int concurrencyLevel)
Constructor that defines the load factor and concurrencyLevel
|
Object2FloatConcurrentOpenHashMap(int minCapacity)
Constructor that defines the minimum capacity
|
Object2FloatConcurrentOpenHashMap(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
Object2FloatConcurrentOpenHashMap(int minCapacity,
float loadFactor,
int concurrencyLevel)
Constructor that defines the minimum capacity, load factor and concurrencyLevel
|
Object2FloatConcurrentOpenHashMap(int minCapacity,
int concurrencyLevel)
Constructor that defines the minimum capacity and concurrencyLevel
|
Object2FloatConcurrentOpenHashMap(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.
|
Object2FloatConcurrentOpenHashMap(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.
|
Object2FloatConcurrentOpenHashMap(java.util.Map<? extends T,? extends java.lang.Float> map,
float loadFactor,
int concurrencyLevel)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2FloatConcurrentOpenHashMap(java.util.Map<? extends T,? extends java.lang.Float> map,
int concurrencyLevel)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2FloatConcurrentOpenHashMap(Object2FloatMap<T> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2FloatConcurrentOpenHashMap(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.
|
Object2FloatConcurrentOpenHashMap(Object2FloatMap<T> map,
float loadFactor,
int concurrencyLevel)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2FloatConcurrentOpenHashMap(Object2FloatMap<T> map,
int concurrencyLevel)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2FloatConcurrentOpenHashMap(T[] keys,
float[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2FloatConcurrentOpenHashMap(T[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Object2FloatConcurrentOpenHashMap(T[] keys,
float[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
Object2FloatConcurrentOpenHashMap(T[] keys,
java.lang.Float[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Object2FloatConcurrentOpenHashMap(T[] keys,
float[] values,
float loadFactor,
int concurrencyLevel)
Helper constructor that allow to create a map from unboxed values
|
Object2FloatConcurrentOpenHashMap(T[] keys,
java.lang.Float[] values,
float loadFactor,
int concurrencyLevel)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Object2FloatConcurrentOpenHashMap(T[] keys,
float[] values,
int concurrencyLevel)
Helper constructor that allow to create a map from unboxed values
|
Object2FloatConcurrentOpenHashMap(T[] keys,
java.lang.Float[] values,
int concurrencyLevel)
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() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
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 |
containsValue(float value)
Type Specific method to reduce boxing/unboxing of values
|
Object2FloatConcurrentOpenHashMap<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
|
java.lang.Float |
get(java.lang.Object key) |
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
|
boolean |
isEmpty() |
ObjectSet<T> |
keySet() |
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.
|
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
|
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
FloatCollection |
values() |
addToAll, containsKey, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, mergeAllFloat, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceFloats, replaceFloats, setDefaultReturnValuecompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, replace, replace, replaceAlladdToAll, builder, containsValue, entrySet, getDefaultReturnValue, mergeAllFloat, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceFloats, replaceFloats, setDefaultReturnValue, synchronize, synchronize, unmodifiableclearAndTrim, trimpublic Object2FloatConcurrentOpenHashMap()
public Object2FloatConcurrentOpenHashMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Object2FloatConcurrentOpenHashMap(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2FloatConcurrentOpenHashMap(int minCapacity,
int concurrencyLevel)
minCapacity - the minimum capacity the HashMap is allowed to be.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(float loadFactor,
int concurrencyLevel)
loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(int minCapacity,
float loadFactor,
int concurrencyLevel)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(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 Object2FloatConcurrentOpenHashMap(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 Object2FloatConcurrentOpenHashMap(T[] keys, java.lang.Float[] values, int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(T[] keys, java.lang.Float[] values, float loadFactor, int concurrencyLevel)
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 resizeconcurrencyLevel - decides how many operations can be performed at once.java.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 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(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 Object2FloatConcurrentOpenHashMap(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 Object2FloatConcurrentOpenHashMap(T[] keys, float[] values, int concurrencyLevel)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.concurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(T[] keys, float[] values, float loadFactor, int concurrencyLevel)
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 resizeconcurrencyLevel - decides how many operations can be performed at once.java.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 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(java.util.Map<? extends T,? extends java.lang.Float> map)
map - the values that should be present in the mappublic Object2FloatConcurrentOpenHashMap(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 Object2FloatConcurrentOpenHashMap(java.util.Map<? extends T,? extends java.lang.Float> map, int concurrencyLevel)
map - the values that should be present in the mapconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(java.util.Map<? extends T,? extends java.lang.Float> map, float loadFactor, int concurrencyLevel)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(Object2FloatMap<T> map)
map - the values that should be present in the mappublic Object2FloatConcurrentOpenHashMap(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 Object2FloatConcurrentOpenHashMap(Object2FloatMap<T> map, int concurrencyLevel)
map - the values that should be present in the mapconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public Object2FloatConcurrentOpenHashMap(Object2FloatMap<T> map, float loadFactor, int concurrencyLevel)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizeconcurrencyLevel - decides how many operations can be performed at once.java.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if the concurrencyLevel is either below/equal to 0 or above/equal to 65535public 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 rem(T key)
Object2FloatMaprem in interface Object2FloatMap<T>key - the element that should be removedpublic 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.concurrent.ConcurrentMap<T,java.lang.Float>remove in interface java.util.Map<T,java.lang.Float>remove in interface Object2FloatConcurrentMap<T>remove in interface Object2FloatMap<T>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public 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)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 void forEach(ObjectFloatConsumer<T> action)
Object2FloatMapforEach in interface Object2FloatMap<T>forEach in class AbstractObject2FloatMap<T>action - processor of the values that are iterator overpublic Object2FloatConcurrentOpenHashMap<T> copy()
Object2FloatMapcopy in interface Object2FloatMap<T>copy in class AbstractObject2FloatMap<T>public boolean containsValue(float value)
Object2FloatMapcontainsValue in interface Object2FloatMap<T>containsValue in class AbstractObject2FloatMap<T>value - element that is searched forpublic 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 clear()
public boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic boolean isEmpty()
public int size()
public ObjectSet<Object2FloatMap.Entry<T>> object2FloatEntrySet()
Object2FloatMapobject2FloatEntrySet in interface Object2FloatMap<T>public ObjectSet<T> keySet()
keySet in interface java.util.Map<T,java.lang.Float>keySet in interface Object2FloatMap<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>