Modul speiger.src.collections
Schnittstelle Short2ShortMap
- Alle Superschnittstellen:
Map<Short,,Short> ShortUnaryOperator
- Alle bekannten Unterschnittstellen:
Short2ShortConcurrentMap,Short2ShortNavigableMap,Short2ShortOrderedMap,Short2ShortSortedMap
- Alle bekannten Implementierungsklassen:
AbstractShort2ShortMap,ImmutableShort2ShortOpenHashMap,Short2ShortArrayMap,Short2ShortAVLTreeMap,Short2ShortConcurrentOpenHashMap,Short2ShortLinkedOpenCustomHashMap,Short2ShortLinkedOpenHashMap,Short2ShortMaps.EmptyMap,Short2ShortMaps.SingletonMap,Short2ShortMaps.SynchronizedMap,Short2ShortMaps.SynchronizedNavigableMap,Short2ShortMaps.SynchronizedOrderedMap,Short2ShortMaps.SynchronizedSortedMap,Short2ShortMaps.UnmodifyableMap,Short2ShortMaps.UnmodifyableNavigableMap,Short2ShortMaps.UnmodifyableOrderedMap,Short2ShortMaps.UnmodifyableSortedMap,Short2ShortOpenCustomHashMap,Short2ShortOpenHashMap,Short2ShortRBTreeMap
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 TypMethodeBeschreibungshortaddTo(short key, short value) A Helper method to add a primitives together.voidA Helper method to bulk add primitives together.default shortapplyAsShort(short key) Type Specific get function to reduce boxing/unboxingstatic Short2ShortMap.MapBuilderbuilder()Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.default ShortVeraltet.default ShortcomputeIfAbsent(Short key, Function<? super Short, ? extends Short> mappingFunction) Veraltet.default ShortcomputeIfPresent(Short key, BiFunction<? super Short, ? super Short, ? extends Short> mappingFunction) Veraltet.shortcomputeShort(short key, ShortShortUnaryOperator 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".shortcomputeShortIfAbsent(short key, ShortUnaryOperator 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".shortcomputeShortIfAbsentNonDefault(short key, ShortUnaryOperator 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".shortcomputeShortIfPresent(short key, ShortShortUnaryOperator 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".shortcomputeShortIfPresentNonDefault(short key, ShortShortUnaryOperator 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".shortcomputeShortNonDefault(short key, ShortShortUnaryOperator 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(short key) Type Specific method to reduce boxing/unboxing of valuesdefault booleancontainsKey(Object key) booleancontainsValue(short 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.default voidforEach(BiConsumer<? super Short, ? super Short> action) Veraltet.voidforEach(ShortShortConsumer action) Type Specific forEach method to reduce boxing/unboxingshortget(short key) A Type Specific get method to reduce boxing/unboxingdefault ShortVeraltet.shortMethod to see what the default return value is.shortgetOrDefault(short key, short defaultValue) A Type Specific getOrDefault method to reduce boxing/unboxingdefault ShortgetOrDefault(Object key, Short defaultValue) Veraltet.keySet()default Shortmerge(Short key, Short value, BiFunction<? super Short, ? super Short, ? extends Short> mappingFunction) Veraltet.voidmergeAllShort(Short2ShortMap m, ShortShortUnaryOperator mappingFunction) A Bulk method for merging Maps.shortmergeShort(short key, short value, ShortShortUnaryOperator 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".shortput(short key, short value) Type Specific method to reduce boxing/unboxing of valuesdefault ShortVeraltet.default ShortA Helper method that allows to put int a Map.Entry into a map.default shortput(Short2ShortMap.Entry entry) A Helper method that allows to put int a Short2ShortMap.Entry into a map.default voidputAll(short[] keys, short[] values) Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performancesvoidputAll(short[] keys, short[] 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.shortputIfAbsent(short key, short value) Type Specific method to reduce boxing/unboxing of valuesdefault ShortputIfAbsent(Short key, Short value) Veraltet.shortremove(short key) Type Specific remove function to reduce boxing/unboxingbooleanremove(short key, short value) Type Specific remove function to reduce boxing/unboxingdefault Shortdefault booleanshortremoveOrDefault(short key, short defaultValue) Type-Specific Remove function with a default return value if wanted.shortreplace(short key, short value) A Type Specific replace method to reduce boxing/unboxing replace an existing valuebooleanreplace(short key, short oldValue, short newValue) A Type Specific replace method to replace an existing valuedefault ShortVeraltet.default booleanVeraltet.default voidreplaceAll(BiFunction<? super Short, ? super Short, ? extends Short> mappingFunction) Veraltet.voidreplaceShorts(ShortShortUnaryOperator mappingFunction) A Type Specific mass replace method to reduce boxing/unboxingvoidType-Specific bulk replace method.setDefaultReturnValue(short v) Method to define the default return value if a requested key isn't presentType Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.shortsubFrom(short key, short value) A Helper method to subtract from primitive from each other.shortsupplyShortIfAbsent(short key, ShortSupplier 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".shortsupplyShortIfAbsentNonDefault(short key, ShortSupplier 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 Short2ShortMapCreates a Wrapped Map that is Synchronizeddefault Short2ShortMapsynchronize(Object mutex) Creates a Wrapped Map that is Synchronizeddefault Short2ShortMapCreates a Wrapped Map that is unmodifiablevalues()Von Schnittstelle geerbte Methoden speiger.src.collections.shorts.functions.function.ShortUnaryOperator
andThen, compose
-
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
short 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
Short2ShortMap 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
short put(short key, short 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 Short2ShortMap.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(short[] keys, short[] 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(short[] keys, short[] 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
short putIfAbsent(short key, short 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
short addTo(short key, short 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
short subFrom(short key, short 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(short 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<Short,Short> - Parameter:
key- that is searched for.- Gibt zurück:
- true if found
- Siehe auch:
- Note:
- in some implementations key does not have to be Short but just have to support equals with Short.
-
containsValue
boolean containsValue(short 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<Short,Short> - 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
short remove(short 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(short key, short 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
short removeOrDefault(short key, short 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(short key, short oldValue, short 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
short replace(short key, short 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
-
replaceShorts
Type-Specific bulk replace method. Could be seen as putAllIfPresent- Parameter:
m- elements that should be replaced.
-
replaceShorts
A Type Specific mass replace method to reduce boxing/unboxing- Parameter:
mappingFunction- operation to replace all values
-
computeShort
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
-
computeShortIfAbsent
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
-
supplyShortIfAbsent
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
-
computeShortIfPresent
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
-
computeShortNonDefault
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
-
computeShortIfAbsentNonDefault
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
-
supplyShortIfAbsentNonDefault
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
-
computeShortIfPresentNonDefault
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
-
mergeShort
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
-
mergeAllShort
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. -
applyAsShort
default short applyAsShort(short key) Beschreibung aus Schnittstelle kopiert:ShortUnaryOperatorType Specific get function to reduce boxing/unboxing- Angegeben von:
applyAsShortin SchnittstelleShortUnaryOperator- Parameter:
key- the value that should be processed- Gibt zurück:
- the result of the function
-
get
short get(short 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
short getOrDefault(short key, short 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<Short,Short>
-
replaceAll
@Deprecated default void replaceAll(BiFunction<? super Short, ? super Short, ? extends Short> mappingFunction) Veraltet.- Angegeben von:
replaceAllin SchnittstelleMap<Short,Short>
-
compute
@Deprecated default Short compute(Short key, BiFunction<? super Short, ? super Short, ? extends Short> mappingFunction) Veraltet. -
computeIfAbsent
@Deprecated default Short computeIfAbsent(Short key, Function<? super Short, ? extends Short> mappingFunction) Veraltet.- Angegeben von:
computeIfAbsentin SchnittstelleMap<Short,Short>
-
computeIfPresent
@Deprecated default Short computeIfPresent(Short key, BiFunction<? super Short, ? super Short, ? extends Short> mappingFunction) Veraltet.- Angegeben von:
computeIfPresentin SchnittstelleMap<Short,Short>
-
merge
@Deprecated default Short merge(Short key, Short value, BiFunction<? super Short, ? super Short, ? extends Short> mappingFunction) Veraltet. -
forEach
Type Specific forEach method to reduce boxing/unboxing- Parameter:
action- processor of the values that are iterator over
-
forEach
Veraltet. -
keySet
ShortSet keySet() -
values
ShortCollection values() -
entrySet
Veraltet. -
short2ShortEntrySet
ObjectSet<Short2ShortMap.Entry> short2ShortEntrySet()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<Short,Short>
-