Modul speiger.src.collections
Schnittstelle Object2ObjectMap<T,V>
- Typparameter:
T- the keyType of elements maintained by this CollectionV- the keyType of elements maintained by this Collection
- Alle Superschnittstellen:
Function<T,,V> Map<T,,V> UnaryOperator<T,V>
- Alle bekannten Unterschnittstellen:
Object2ObjectConcurrentMap<T,,V> Object2ObjectNavigableMap<T,,V> Object2ObjectOrderedMap<T,,V> Object2ObjectSortedMap<T,V>
- Alle bekannten Implementierungsklassen:
AbstractObject2ObjectMap,Enum2ObjectMap,ImmutableObject2ObjectOpenHashMap,LinkedEnum2ObjectMap,Object2ObjectArrayMap,Object2ObjectAVLTreeMap,Object2ObjectConcurrentOpenHashMap,Object2ObjectLinkedOpenCustomHashMap,Object2ObjectLinkedOpenHashMap,Object2ObjectMaps.EmptyMap,Object2ObjectMaps.SingletonMap,Object2ObjectMaps.SynchronizedMap,Object2ObjectMaps.SynchronizedNavigableMap,Object2ObjectMaps.SynchronizedOrderedMap,Object2ObjectMaps.SynchronizedSortedMap,Object2ObjectMaps.UnmodifyableMap,Object2ObjectMaps.UnmodifyableNavigableMap,Object2ObjectMaps.UnmodifyableOrderedMap,Object2ObjectMaps.UnmodifyableSortedMap,Object2ObjectOpenCustomHashMap,Object2ObjectOpenHashMap,Object2ObjectRBTreeMap
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 TypMethodeBeschreibungdefault VType Specific get function to reduce boxing/unboxingstatic Object2ObjectMap.MapBuilderbuilder()Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.default Vcompute(T key, ObjectObjectUnaryOperator<T, V> 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".default VcomputeIfAbsent(T key, Function<? super T, ? extends V> mappingFunction) computeIfAbsent(T key, UnaryOperator<T, V> 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".default VcomputeIfPresent(T key, BiFunction<? super T, ? super V, ? extends V> mappingFunction) computeIfPresent(T key, ObjectObjectUnaryOperator<T, V> 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".copy()A Function that does a shallow clone of the Map itself.entrySet()default voidforEach(BiConsumer<? super T, ? super V> action) voidforEach(ObjectObjectConsumer<T, V> action) Type Specific forEach method to reduce boxing/unboxingMethod to see what the default return value is.A Type Specific get method to reduce boxing/unboxingkeySet()default VA 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".voidmergeAll(Object2ObjectMap<T, V> m, ObjectObjectUnaryOperator<V, V> mappingFunction) A Bulk method for merging Maps.Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.default Vput(Object2ObjectMap.Entry<T, V> entry) A Helper method that allows to put int a Object2ObjectMap.Entry into a map.Type Specific method to reduce boxing/unboxing of valuesvoidputAll(Object2ObjectMap<T, V> m) Type Specific function for the bull putting of valuesdefault voidType Specific array method to bulk add elements into a map without creating a wrapper and increasing performancesvoidType Specific array method to bulk add elements into a map without creating a wrapper and increasing performancesvoidType-Specific bulk put method put elements into the map if not present.putIfAbsent(T key, V value) Type Specific method to reduce boxing/unboxing of valuesType Specific remove function to reduce boxing/unboxingremOrDefault(T key, V defaultValue) Type-Specific Remove function with a default return value if wanted.default VA Type Specific replace method to reduce boxing/unboxing replace an existing valuebooleanA Type Specific replace method to replace an existing valuedefault voidreplaceAll(BiFunction<? super T, ? super V, ? extends V> mappingFunction) voidreplaceObjects(ObjectObjectUnaryOperator<T, V> mappingFunction) A Type Specific mass replace method to reduce boxing/unboxingvoidType-Specific bulk replace method.Method to define the default return value if a requested key isn't presentsupplyIfAbsent(T key, ObjectSupplier<V> 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 Object2ObjectMap<T,V> Creates a Wrapped Map that is Synchronizeddefault Object2ObjectMap<T,V> synchronize(Object mutex) Creates a Wrapped Map that is Synchronizeddefault Object2ObjectMap<T,V> Creates a Wrapped Map that is unmodifiablevalues()Von Schnittstelle geerbte Methoden java.util.Map
clear, containsKey, containsValue, equals, get, getOrDefault, hashCode, isEmpty, putAll, remove, sizeVon Schnittstelle geerbte Methoden speiger.src.collections.objects.functions.function.UnaryOperator
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
V 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
Object2ObjectMap<T,V> 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
Type Specific method to reduce boxing/unboxing of values -
put
A Helper method that allows to put int a Object2ObjectMap.Entry into a map.- Parameter:
entry- then Entry that should be inserted.- Gibt zurück:
- the last present value or default return value.
-
putAll
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
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:
-
putIfAbsent
Type Specific method to reduce boxing/unboxing of values- Angegeben von:
putIfAbsentin SchnittstelleMap<T,V> - 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.
-
putAll
Type Specific function for the bull putting of values- Parameter:
m- the elements that should be inserted
-
rem
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
-
remOrDefault
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
A Type Specific replace method to replace an existing value- Angegeben von:
replacein SchnittstelleMap<T,V> - 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
A Type Specific replace method to reduce boxing/unboxing replace an existing value -
replaceObjects
Type-Specific bulk replace method. Could be seen as putAllIfPresent- Parameter:
m- elements that should be replaced.
-
replaceObjects
A Type Specific mass replace method to reduce boxing/unboxing- Parameter:
mappingFunction- operation to replace all values
-
compute
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
-
computeIfAbsent
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
-
supplyIfAbsent
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
-
computeIfPresent
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
-
merge
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
-
mergeAll
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
-
apply
Beschreibung aus Schnittstelle kopiert:UnaryOperatorType Specific get function to reduce boxing/unboxing -
getObject
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
-
replaceAll
- Angegeben von:
replaceAllin SchnittstelleMap<T,V>
-
compute
-
computeIfAbsent
- Angegeben von:
computeIfAbsentin SchnittstelleMap<T,V>
-
computeIfPresent
- Angegeben von:
computeIfPresentin SchnittstelleMap<T,V>
-
merge
-
forEach
Type Specific forEach method to reduce boxing/unboxing- Parameter:
action- processor of the values that are iterator over
-
forEach
-
keySet
-
values
ObjectCollection<V> values() -
entrySet
-
object2ObjectEntrySet
ObjectSet<Object2ObjectMap.Entry<T,V>> object2ObjectEntrySet()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:
-