public class Long2FloatArrayMap extends AbstractLong2FloatMap implements Long2FloatSortedMap
AbstractLong2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2FloatSortedMap.FastSortedSetLong2FloatMap.Entry, Long2FloatMap.FastEntrySet| Constructor and Description |
|---|
Long2FloatArrayMap()
Default Constructor
|
Long2FloatArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Long2FloatArrayMap(long[] keys,
float[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2FloatArrayMap(java.lang.Long[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2FloatArrayMap(long[] keys,
float[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Long2FloatArrayMap(java.lang.Long[] keys,
java.lang.Float[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Long2FloatArrayMap(Long2FloatMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2FloatArrayMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Float> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
float |
addTo(long key,
float value)
A Helper method to add a primitives together.
|
void |
clear() |
LongComparator |
comparator() |
float |
computeFloat(long key,
LongFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfAbsent(long key,
Long2FloatFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfPresent(long key,
LongFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long key)
Type Specific method to reduce boxing/unboxing of values
|
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) |
float |
firstFloatValue()
A method to get the first Value of a Map.
|
long |
firstLongKey()
A method to get the first Key of a Map.
|
void |
forEach(LongFloatConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
float |
getAndMoveToFirst(long key)
A Specific get method that allows to move teh given key/value int the first index.
|
float |
getAndMoveToLast(long key)
A Specific get method that allows to move teh given key/value int the last index.
|
float |
getFloat(long key)
A Type Specific get method to reduce boxing/unboxing
|
float |
getOrDefault(long key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Long2FloatSortedMap |
headMap(long toKey)
A Type Specific HeadMap method to reduce boxing/unboxing
|
LongSet |
keySet() |
float |
lastFloatValue()
A method to get the last Value of a Map.
|
long |
lastLongKey()
A method to get the last Key of a Map.
|
ObjectSortedSet<Long2FloatMap.Entry> |
long2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
mergeAllFloat(Long2FloatMap m,
FloatFloatUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
float |
mergeFloat(long key,
float value,
FloatFloatUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(long key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(long key)
A specific move method to move a given key/value to the last index.
|
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
long |
pollLastLongKey()
A method to get and remove the last Key of a Map.
|
float |
put(long key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putAndMoveToFirst(long key,
float value)
A customized put method that allows you to insert into the first index.
|
float |
putAndMoveToLast(long key,
float value)
A customized put method that allows you to insert into the last index.
|
float |
putIfAbsent(long key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
remLong(long key)
Type Specific remove function to reduce boxing/unboxing
|
float |
remLongOrDefault(long key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(long key,
float value)
Type Specific remove function to reduce boxing/unboxing
|
java.lang.Float |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
float |
replace(long key,
float value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
Long2FloatSortedMap |
subMap(long fromKey,
long toKey)
A Type Specific SubMap method to reduce boxing/unboxing
|
Long2FloatSortedMap |
tailMap(long fromKey)
A Type Specific TailMap method to reduce boxing/unboxing
|
FloatCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceFloats, replaceFloats, setDefaultReturnValuefirstKey, headMap, lastKey, subMap, tailMapaddToAll, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceFloats, replaceFloats, setDefaultReturnValuepublic Long2FloatArrayMap()
public Long2FloatArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Long2FloatArrayMap(java.lang.Long[] 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 lengthpublic Long2FloatArrayMap(java.lang.Long[] keys,
java.lang.Float[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lengthpublic Long2FloatArrayMap(long[] 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 Long2FloatArrayMap(long[] keys,
float[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Long2FloatArrayMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Float> map)
map - the values that should be present in the mappublic Long2FloatArrayMap(Long2FloatMap map)
map - the values that should be present in the mappublic float put(long key,
float value)
Long2FloatMapput in interface Long2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(long key,
float value)
Long2FloatMapputIfAbsent in interface Long2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(long key,
float value)
Long2FloatMapaddTo in interface Long2FloatMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic float putAndMoveToFirst(long key,
float value)
Long2FloatSortedMapputAndMoveToFirst in interface Long2FloatSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public float putAndMoveToLast(long key,
float value)
Long2FloatSortedMapputAndMoveToLast in interface Long2FloatSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(long key)
Long2FloatSortedMapmoveToFirst in interface Long2FloatSortedMapkey - that should be moved to the first indexpublic boolean moveToLast(long key)
Long2FloatSortedMapmoveToLast in interface Long2FloatSortedMapkey - that should be moved to the first lastpublic boolean containsKey(long key)
Long2FloatMapcontainsKey in interface Long2FloatMapcontainsKey in class AbstractLong2FloatMapkey - element that is searched forpublic boolean containsValue(float value)
Long2FloatMapcontainsValue in interface Long2FloatMapcontainsValue in class AbstractLong2FloatMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Long,java.lang.Float>containsKey in interface Long2FloatMapcontainsKey in class java.util.AbstractMap<java.lang.Long,java.lang.Float>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Long,java.lang.Float>containsValue in interface Long2FloatMapcontainsValue in class java.util.AbstractMap<java.lang.Long,java.lang.Float>value - that is searched for.Map.containsValue(Object)public float getFloat(long key)
Long2FloatMapgetFloat in interface Long2FloatFunctiongetFloat in interface Long2FloatMapkey - the key that is searched forpublic float getOrDefault(long key,
float defaultValue)
Long2FloatMapgetOrDefault in interface Long2FloatMapgetOrDefault in class AbstractLong2FloatMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic float getAndMoveToFirst(long key)
Long2FloatSortedMapgetAndMoveToFirst in interface Long2FloatSortedMapkey - that is searched forpublic float getAndMoveToLast(long key)
Long2FloatSortedMapgetAndMoveToLast in interface Long2FloatSortedMapkey - that is searched forpublic long firstLongKey()
Long2FloatSortedMapfirstLongKey in interface Long2FloatSortedMappublic long lastLongKey()
Long2FloatSortedMaplastLongKey in interface Long2FloatSortedMappublic float firstFloatValue()
Long2FloatSortedMapfirstFloatValue in interface Long2FloatSortedMappublic float lastFloatValue()
Long2FloatSortedMaplastFloatValue in interface Long2FloatSortedMappublic long pollFirstLongKey()
Long2FloatSortedMappollFirstLongKey in interface Long2FloatSortedMappublic long pollLastLongKey()
Long2FloatSortedMappollLastLongKey in interface Long2FloatSortedMappublic float remLong(long key)
Long2FloatMapremLong in interface Long2FloatMapkey - the element that should be removedpublic float remLongOrDefault(long key,
float defaultValue)
Long2FloatMapremLongOrDefault in interface Long2FloatMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(long key,
float value)
Long2FloatMapremove in interface Long2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public java.lang.Float remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Long,java.lang.Float>remove in interface Long2FloatMapremove in class java.util.AbstractMap<java.lang.Long,java.lang.Float>key - the element that should be removedMap.remove(Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<java.lang.Long,java.lang.Float>remove in interface Long2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(LongFloatConsumer action)
Long2FloatMapforEach in interface Long2FloatMapforEach in class AbstractLong2FloatMapaction - processor of the values that are iterator overpublic LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Float>keySet in interface java.util.SortedMap<java.lang.Long,java.lang.Float>keySet in interface Long2FloatMapkeySet in interface Long2FloatSortedMapkeySet in class AbstractLong2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Float>values in interface java.util.SortedMap<java.lang.Long,java.lang.Float>values in interface Long2FloatMapvalues in interface Long2FloatSortedMapvalues in class AbstractLong2FloatMappublic ObjectSortedSet<Long2FloatMap.Entry> long2FloatEntrySet()
Long2FloatMaplong2FloatEntrySet in interface Long2FloatMappublic boolean replace(long key,
float oldValue,
float newValue)
Long2FloatMapreplace in interface Long2FloatMapreplace in class AbstractLong2FloatMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public float replace(long key,
float value)
Long2FloatMapreplace in interface Long2FloatMapreplace in class AbstractLong2FloatMapkey - the element that should be searched forvalue - the value to replace with.public float computeFloat(long key,
LongFloatUnaryOperator mappingFunction)
Long2FloatMapcomputeFloat in interface Long2FloatMapcomputeFloat in class AbstractLong2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic float computeFloatIfAbsent(long key,
Long2FloatFunction mappingFunction)
Long2FloatMapcomputeFloatIfAbsent in interface Long2FloatMapcomputeFloatIfAbsent in class AbstractLong2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic float computeFloatIfPresent(long key,
LongFloatUnaryOperator mappingFunction)
Long2FloatMapcomputeFloatIfPresent in interface Long2FloatMapcomputeFloatIfPresent in class AbstractLong2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic float mergeFloat(long key,
float value,
FloatFloatUnaryOperator mappingFunction)
Long2FloatMapmergeFloat in interface Long2FloatMapmergeFloat in class AbstractLong2FloatMapkey - 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(Long2FloatMap m, FloatFloatUnaryOperator mappingFunction)
Long2FloatMapmergeAllFloat in interface Long2FloatMapmergeAllFloat in class AbstractLong2FloatMapm - 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.Long,java.lang.Float>size in class java.util.AbstractMap<java.lang.Long,java.lang.Float>public void clear()
clear in interface java.util.Map<java.lang.Long,java.lang.Float>clear in class java.util.AbstractMap<java.lang.Long,java.lang.Float>public LongComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Long,java.lang.Float>comparator in interface Long2FloatSortedMappublic Long2FloatSortedMap subMap(long fromKey, long toKey)
Long2FloatSortedMapsubMap in interface Long2FloatSortedMapfromKey - where the submap should starttoKey - where the subMap should endpublic Long2FloatSortedMap headMap(long toKey)
Long2FloatSortedMapheadMap in interface Long2FloatSortedMaptoKey - where the headMap should endpublic Long2FloatSortedMap tailMap(long fromKey)
Long2FloatSortedMaptailMap in interface Long2FloatSortedMapfromKey - where the TailMap should start