Modul speiger.src.collections
Schnittstelle Float2LongMap
- Alle Superschnittstellen:
Float2LongFunction,Map<Float,Long>
- Alle bekannten Unterschnittstellen:
Float2LongConcurrentMap,Float2LongNavigableMap,Float2LongOrderedMap,Float2LongSortedMap
- Alle bekannten Implementierungsklassen:
AbstractFloat2LongMap,Float2LongArrayMap,Float2LongAVLTreeMap,Float2LongConcurrentOpenHashMap,Float2LongLinkedOpenCustomHashMap,Float2LongLinkedOpenHashMap,Float2LongMaps.EmptyMap,Float2LongMaps.SingletonMap,Float2LongMaps.SynchronizedMap,Float2LongMaps.SynchronizedNavigableMap,Float2LongMaps.SynchronizedOrderedMap,Float2LongMaps.SynchronizedSortedMap,Float2LongMaps.UnmodifyableMap,Float2LongMaps.UnmodifyableNavigableMap,Float2LongMaps.UnmodifyableOrderedMap,Float2LongMaps.UnmodifyableSortedMap,Float2LongOpenCustomHashMap,Float2LongOpenHashMap,Float2LongRBTreeMap,ImmutableFloat2LongOpenHashMap
A Type Specific Map that reduces memory overhead due to boxing/unboxing of Primitives
and some extra helper functions.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypSchnittstelleBeschreibungstatic classBuilder Cache for allowing to buildMapsstatic interfaceType Specific Map Entry that reduces boxing/unboxingstatic interfaceFast Entry set that allows for a faster Entry Iterator by recycling the Entry Object and just exchanging 1 internal valuestatic final classHelper class that reduces the method spam of the Map Class. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunglongaddTo(float key, long value) A Helper method to add a primitives together.voidA Helper method to bulk add primitives together.default longapplyAsLong(float key) Type Specific get function to reduce boxing/unboxingstatic Float2LongMap.MapBuilderbuilder()Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.default LongVeraltet.default LongcomputeIfAbsent(Float key, Function<? super Float, ? extends Long> mappingFunction) Veraltet.default LongcomputeIfPresent(Float key, BiFunction<? super Float, ? super Long, ? extends Long> mappingFunction) Veraltet.longcomputeLong(float key, FloatLongUnaryOperator mappingFunction) A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".longcomputeLongIfAbsent(float key, Float2LongFunction mappingFunction) A Type Specific computeIfAbsent method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".longcomputeLongIfAbsentNonDefault(float key, Float2LongFunction mappingFunction) A Type Specific computeIfAbsent method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".longcomputeLongIfPresent(float key, FloatLongUnaryOperator mappingFunction) A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".longcomputeLongIfPresentNonDefault(float key, FloatLongUnaryOperator mappingFunction) A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".longcomputeLongNonDefault(float key, FloatLongUnaryOperator mappingFunction) A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".booleancontainsKey(float key) Type Specific method to reduce boxing/unboxing of valuesdefault booleancontainsKey(Object key) booleancontainsValue(long value) Type Specific method to reduce boxing/unboxing of valuesdefault booleancontainsValue(Object value) copy()A Function that does a shallow clone of the Map itself.entrySet()Veraltet.Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.default voidforEach(BiConsumer<? super Float, ? super Long> action) Veraltet.voidforEach(FloatLongConsumer action) Type Specific forEach method to reduce boxing/unboxinglongget(float key) A Type Specific get method to reduce boxing/unboxingdefault LongVeraltet.longMethod to see what the default return value is.longgetOrDefault(float key, long defaultValue) A Type Specific getOrDefault method to reduce boxing/unboxingdefault LonggetOrDefault(Object key, Long defaultValue) Veraltet.keySet()default LongVeraltet.voidmergeAllLong(Float2LongMap m, LongLongUnaryOperator mappingFunction) A Bulk method for merging Maps.longmergeLong(float key, long value, LongLongUnaryOperator mappingFunction) A Type Specific merge method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".longput(float key, long value) Type Specific method to reduce boxing/unboxing of valuesdefault LongVeraltet.default LongA Helper method that allows to put int a Map.Entry into a map.default longput(Float2LongMap.Entry entry) A Helper method that allows to put int a Float2LongMap.Entry into a map.default voidputAll(float[] keys, long[] values) Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performancesvoidputAll(float[] keys, long[] values, int offset, int size) Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performancesdefault voidType Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performancesvoidType Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performancesvoidType Specific function for the bull putting of valuesvoidType-Specific bulk put method put elements into the map if not present.longputIfAbsent(float key, long value) Type Specific method to reduce boxing/unboxing of valuesdefault LongputIfAbsent(Float key, Long value) Veraltet.longremove(float key) Type Specific remove function to reduce boxing/unboxingbooleanremove(float key, long value) Type Specific remove function to reduce boxing/unboxingdefault Longdefault booleanlongremoveOrDefault(float key, long defaultValue) Type-Specific Remove function with a default return value if wanted.longreplace(float key, long value) A Type Specific replace method to reduce boxing/unboxing replace an existing valuebooleanreplace(float key, long oldValue, long newValue) A Type Specific replace method to replace an existing valuedefault LongVeraltet.default booleanVeraltet.default voidreplaceAll(BiFunction<? super Float, ? super Long, ? extends Long> mappingFunction) Veraltet.voidreplaceLongs(FloatLongUnaryOperator mappingFunction) A Type Specific mass replace method to reduce boxing/unboxingvoidType-Specific bulk replace method.setDefaultReturnValue(long v) Method to define the default return value if a requested key isn't presentlongsubFrom(float key, long value) A Helper method to subtract from primitive from each other.longsupplyLongIfAbsent(float key, LongSupplier valueProvider) A Supplier based computeIfAbsent function to fill the most used usecase of this function If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".longsupplyLongIfAbsentNonDefault(float key, LongSupplier valueProvider) A Supplier based computeIfAbsent function to fill the most used usecase of this function If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null".default Float2LongMapCreates a Wrapped Map that is Synchronizeddefault Float2LongMapsynchronize(Object mutex) Creates a Wrapped Map that is Synchronizeddefault Float2LongMapCreates a Wrapped Map that is unmodifiablevalues()
-
Methodendetails
-
builder
Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.- Gibt zurück:
- a MapBuilder
-
getDefaultReturnValue
long getDefaultReturnValue()Method to see what the default return value is.- Gibt zurück:
- default return value
-
setDefaultReturnValue
Method to define the default return value if a requested key isn't present- Parameter:
v- value that should be the default return value- Gibt zurück:
- itself
-
copy
Float2LongMap copy()A Function that does a shallow clone of the Map itself. This function is more optimized then a copy constructor since the Map does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk- Gibt zurück:
- a Shallow Copy of the Map
- Note:
- Wrappers and view Maps will not support this feature
-
put
long put(float key, long value) Type Specific method to reduce boxing/unboxing of values- Parameter:
key- the key that should be inserted,value- the value that should be inserted- Gibt zurück:
- the last present value or default return value.
- Siehe auch:
-
put
A Helper method that allows to put int a Float2LongMap.Entry into a map.- Parameter:
entry- then Entry that should be inserted.- Gibt zurück:
- the last present value or default return value.
-
put
A Helper method that allows to put int a Map.Entry into a map.- Parameter:
entry- then Entry that should be inserted.- Gibt zurück:
- the last present value or default return value.
-
putAll
default void putAll(float[] keys, long[] values) Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances- Parameter:
keys- the keys that should be addedvalues- the values that should be added- Löst aus:
IllegalStateException- if the arrays are not the same size- Siehe auch:
-
putAll
void putAll(float[] keys, long[] values, int offset, int size) Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances- Parameter:
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 added- Löst aus:
IllegalStateException- if the arrays are not within the range- Siehe auch:
-
putAll
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances- Parameter:
keys- the keys that should be addedvalues- the values that should be added- Löst aus:
IllegalStateException- if the arrays are not the same size- Siehe auch:
-
putAll
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances- Parameter:
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 added- Löst aus:
IllegalStateException- if the arrays are not within the range- Siehe auch:
-
putIfAbsent
long putIfAbsent(float key, long value) Type Specific method to reduce boxing/unboxing of values- Parameter:
key- the key that should be inserted,value- the value that should be inserted- Gibt zurück:
- the last present value or default return value.
- Siehe auch:
-
putAllIfAbsent
Type-Specific bulk put method put elements into the map if not present.- Parameter:
m- elements that should be added if not present.
-
addTo
long addTo(float key, long value) A Helper method to add a primitives together. If key is not present then this functions as a put.- Parameter:
key- the key that should be inserted,value- the value that should be inserted / added- Gibt zurück:
- the last present value or default return value.
-
addToAll
A Helper method to bulk add primitives together.- Parameter:
m- the values that should be added/inserted
-
subFrom
long subFrom(float key, long value) A Helper method to subtract from primitive from each other. If the key is not present it will just return the defaultValue How the implementation works is that it will subtract from the current value (if not present it will do nothing) and fence it to thegetDefaultReturnValue()If the fence is reached the element will be automaticall removed- Parameter:
key- that should be subtract fromvalue- that should be subtract- Gibt zurück:
- the last present or default return value
-
putAll
Type Specific function for the bull putting of values- Parameter:
m- the elements that should be inserted
-
containsKey
boolean containsKey(float key) Type Specific method to reduce boxing/unboxing of values- Parameter:
key- element that is searched for- Gibt zurück:
- if the key is present
-
containsKey
- Angegeben von:
containsKeyin SchnittstelleMap<Float,Long> - Parameter:
key- that is searched for.- Gibt zurück:
- true if found
- Siehe auch:
- Note:
- in some implementations key does not have to be Float but just have to support equals with Float.
-
containsValue
boolean containsValue(long value) Type Specific method to reduce boxing/unboxing of values- Parameter:
value- element that is searched for- Gibt zurück:
- if the value is present
-
containsValue
- Angegeben von:
containsValuein SchnittstelleMap<Float,Long> - Parameter:
value- that is searched for.- Gibt zurück:
- true if found
- Siehe auch:
- Note:
- in some implementations key does not have to be CLASS_VALUE but just have to support equals with CLASS_VALUE.
-
remove
long remove(float key) Type Specific remove function to reduce boxing/unboxing- Parameter:
key- the element that should be removed- Gibt zurück:
- the value that was removed or default return value
-
remove
-
remove
boolean remove(float key, long value) Type Specific remove function to reduce boxing/unboxing- Parameter:
key- the element that should be removedvalue- the expected value that should be found- Gibt zurück:
- true if the key and value was found and removed
- Siehe auch:
-
remove
-
removeOrDefault
long removeOrDefault(float key, long defaultValue) Type-Specific Remove function with a default return value if wanted.- Parameter:
key- the element that should be removeddefaultValue- the value that should be returned if the entry doesn't exist- Gibt zurück:
- the value that was removed or default value
- Siehe auch:
-
replace
boolean replace(float key, long oldValue, long newValue) A Type Specific replace method to replace an existing value- Parameter:
key- the element that should be searched foroldValue- the expected value to be replacednewValue- the value to replace the oldValue with.- Gibt zurück:
- true if the value got replaced
- Note:
- this fails if the value is not present even if it matches the oldValue
-
replace
long replace(float key, long value) A Type Specific replace method to reduce boxing/unboxing replace an existing value- Parameter:
key- the element that should be searched forvalue- the value to replace with.- Gibt zurück:
- the present value or default return value
- Note:
- this fails if the value is not present
-
replaceLongs
Type-Specific bulk replace method. Could be seen as putAllIfPresent- Parameter:
m- elements that should be replaced.
-
replaceLongs
A Type Specific mass replace method to reduce boxing/unboxing- Parameter:
mappingFunction- operation to replace all values
-
computeLong
A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedmappingFunction- the operator that should generate the value- Gibt zurück:
- the result of the computation
-
computeLongIfAbsent
A Type Specific computeIfAbsent method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedmappingFunction- the operator that should generate the value if not present- Gibt zurück:
- the result of the computed value or present value
-
supplyLongIfAbsent
A Supplier based computeIfAbsent function to fill the most used usecase of this function If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedvalueProvider- the value if not present- Gibt zurück:
- the result of the computed value or present value
-
computeLongIfPresent
A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedmappingFunction- the operator that should generate the value if present- Gibt zurück:
- the result of the default return value or present value
- Note:
- if not present then compute is not executed
-
computeLongNonDefault
A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedmappingFunction- the operator that should generate the value- Gibt zurück:
- the result of the computation
-
computeLongIfAbsentNonDefault
A Type Specific computeIfAbsent method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedmappingFunction- the operator that should generate the value if not present- Gibt zurück:
- the result of the computed value or present value
-
supplyLongIfAbsentNonDefault
A Supplier based computeIfAbsent function to fill the most used usecase of this function If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedvalueProvider- the value if not present- Gibt zurück:
- the result of the computed value or present value
-
computeLongIfPresentNonDefault
A Type Specific compute method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be computedmappingFunction- the operator that should generate the value if present- Gibt zurück:
- the result of the default return value or present value
- Note:
- if not present then compute is not executed
-
mergeLong
A Type Specific merge method to reduce boxing/unboxing If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
key- the key that should be be searched forvalue- the value that should be merged withmappingFunction- the operator that should generate the new Value- Gibt zurück:
- the result of the merge
- Note:
- if the result matches the default return value then the key is removed from the map
-
mergeAllLong
A Bulk method for merging Maps. If the generated value equals the getDefaultReturnValue it will simply not insert it since that is treated as "null". A "Null Value" will be treated as "Do not insert/remove" based on how the Java has specified it.- Parameter:
m- the entries that should be bulk addedmappingFunction- the operator that should generate the new Value- Note:
- if the result matches the default return value then the key is removed from the map
-
replace
Veraltet. -
replace
Veraltet. -
applyAsLong
default long applyAsLong(float key) Beschreibung aus Schnittstelle kopiert:Float2LongFunctionType Specific get function to reduce boxing/unboxing- Angegeben von:
applyAsLongin SchnittstelleFloat2LongFunction- Parameter:
key- the value that should be processed- Gibt zurück:
- the result of the function
-
get
long get(float key) A Type Specific get method to reduce boxing/unboxing- Parameter:
key- the key that is searched for- Gibt zurück:
- the searched value or default return value
-
getOrDefault
long getOrDefault(float key, long defaultValue) A Type Specific getOrDefault method to reduce boxing/unboxing- Parameter:
key- the key that is searched fordefaultValue- the value that should be returned if the key is not present- Gibt zurück:
- the searched value or defaultValue value
-
get
Veraltet. -
getOrDefault
Veraltet.- Angegeben von:
getOrDefaultin SchnittstelleMap<Float,Long>
-
replaceAll
@Deprecated default void replaceAll(BiFunction<? super Float, ? super Long, ? extends Long> mappingFunction) Veraltet.- Angegeben von:
replaceAllin SchnittstelleMap<Float,Long>
-
compute
@Deprecated default Long compute(Float key, BiFunction<? super Float, ? super Long, ? extends Long> mappingFunction) Veraltet. -
computeIfAbsent
@Deprecated default Long computeIfAbsent(Float key, Function<? super Float, ? extends Long> mappingFunction) Veraltet.- Angegeben von:
computeIfAbsentin SchnittstelleMap<Float,Long>
-
computeIfPresent
@Deprecated default Long computeIfPresent(Float key, BiFunction<? super Float, ? super Long, ? extends Long> mappingFunction) Veraltet.- Angegeben von:
computeIfPresentin SchnittstelleMap<Float,Long>
-
merge
@Deprecated default Long merge(Float key, Long value, BiFunction<? super Long, ? super Long, ? extends Long> mappingFunction) Veraltet. -
forEach
Type Specific forEach method to reduce boxing/unboxing- Parameter:
action- processor of the values that are iterator over
-
forEach
Veraltet. -
keySet
FloatSet keySet() -
values
LongCollection values() -
entrySet
Veraltet. -
float2LongEntrySet
ObjectSet<Float2LongMap.Entry> float2LongEntrySet()Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.- Gibt zurück:
- a EntrySet of the collection
-
synchronize
Creates a Wrapped Map that is Synchronized- Gibt zurück:
- a new Map that is synchronized
- Siehe auch:
-
synchronize
Creates a Wrapped Map that is Synchronized- Parameter:
mutex- is the controller of the synchronization block- Gibt zurück:
- a new Map Wrapper that is synchronized
- Siehe auch:
-
unmodifiable
Creates a Wrapped Map that is unmodifiable- Gibt zurück:
- a new Map Wrapper that is unmodifiable
- Siehe auch:
-
put
Veraltet. -
putIfAbsent
Veraltet.- Angegeben von:
putIfAbsentin SchnittstelleMap<Float,Long>
-