T - the keyType of elements maintained by this CollectionV - the keyType of elements maintained by this Collectionpublic interface Object2ObjectMap<T,V> extends java.util.Map<T,V>, UnaryOperator<T,V>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Object2ObjectMap.BuilderCache<T,V>
Builder Cache for allowing to buildMaps
|
static interface |
Object2ObjectMap.Entry<T,V>
Type Specific Map Entry that reduces boxing/unboxing
|
static interface |
Object2ObjectMap.FastEntrySet<T,V>
Fast Entry set that allows for a faster Entry Iterator by recycling the Entry Object and just exchanging 1 internal value
|
static class |
Object2ObjectMap.MapBuilder
Helper class that reduces the method spam of the Map Class.
|
| Modifier and Type | Method and Description |
|---|---|
default V |
apply(T key)
Type Specific get function to reduce boxing/unboxing
|
static Object2ObjectMap.MapBuilder |
builder()
Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.
|
default V |
compute(T key,
java.util.function.BiFunction<? super T,? super V,? extends V> mappingFunction) |
V |
compute(T key,
ObjectObjectUnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
default V |
computeIfAbsent(T key,
java.util.function.Function<? super T,? extends V> mappingFunction) |
V |
computeIfAbsent(T key,
UnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
default V |
computeIfPresent(T key,
java.util.function.BiFunction<? super T,? super V,? extends V> mappingFunction) |
V |
computeIfPresent(T key,
ObjectObjectUnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
Object2ObjectMap<T,V> |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<T,V>> |
entrySet() |
default void |
forEach(java.util.function.BiConsumer<? super T,? super V> action) |
void |
forEach(ObjectObjectConsumer<T,V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
getDefaultReturnValue()
Method to see what the default return value is.
|
V |
getObject(T key)
A Type Specific get method to reduce boxing/unboxing
|
ObjectSet<T> |
keySet() |
default V |
merge(T key,
V value,
java.util.function.BiFunction<? super V,? super V,? extends V> mappingFunction) |
V |
merge(T key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Object2ObjectMap<T,V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
ObjectSet<Object2ObjectMap.Entry<T,V>> |
object2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
default V |
put(Object2ObjectMap.Entry<T,V> entry)
A Helper method that allows to put int a Object2ObjectMap.Entry into a map.
|
V |
put(T key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
void |
putAll(Object2ObjectMap<T,V> m)
Type Specific function for the bull putting of values
|
default void |
putAll(T[] keys,
V[] values)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(T[] keys,
V[] values,
int offset,
int size)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAllIfAbsent(Object2ObjectMap<T,V> m)
Type-Specific bulk put method put elements into the map if not present.
|
V |
putIfAbsent(T key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
V |
remOrDefault(T key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
default V |
remove(java.lang.Object key) |
V |
replace(T key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
default void |
replaceAll(java.util.function.BiFunction<? super T,? super V,? extends V> mappingFunction) |
void |
replaceObjects(Object2ObjectMap<T,V> m)
Type-Specific bulk replace method.
|
void |
replaceObjects(ObjectObjectUnaryOperator<T,V> mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
Object2ObjectMap<T,V> |
setDefaultReturnValue(V v)
Method to define the default return value if a requested key isn't present
|
V |
supplyIfAbsent(T key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
default Object2ObjectMap<T,V> |
synchronize()
Creates a Wrapped Map that is Synchronized
|
default Object2ObjectMap<T,V> |
synchronize(java.lang.Object mutex)
Creates a Wrapped Map that is Synchronized
|
default Object2ObjectMap<T,V> |
unmodifiable()
Creates a Wrapped Map that is unmodifiable
|
ObjectCollection<V> |
values() |
clear, containsKey, containsValue, equals, get, getOrDefault, hashCode, isEmpty, putAll, remove, sizeandThen, compose, identitystatic Object2ObjectMap.MapBuilder builder()
V getDefaultReturnValue()
Object2ObjectMap<T,V> setDefaultReturnValue(V v)
v - value that should be the default return valueObject2ObjectMap<T,V> copy()
default V put(Object2ObjectMap.Entry<T,V> entry)
entry - then Entry that should be inserted.default void putAll(T[] keys, V[] values)
keys - the keys that should be addedvalues - the values that should be addedjava.lang.IllegalStateException - if the arrays are not the same sizeMap.putAll(Map)void putAll(T[] keys, V[] values, int offset, int size)
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 addedjava.lang.IllegalStateException - if the arrays are not within the rangeMap.putAll(Map)void putAllIfAbsent(Object2ObjectMap<T,V> m)
m - elements that should be added if not present.void putAll(Object2ObjectMap<T,V> m)
m - the elements that should be insertedV rem(T key)
key - the element that should be removeddefault V remove(java.lang.Object key)
V remOrDefault(T key, V defaultValue)
key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)boolean replace(T key, V oldValue, V newValue)
replace in interface java.util.Map<T,V>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.V replace(T key, V value)
void replaceObjects(Object2ObjectMap<T,V> m)
m - elements that should be replaced.void replaceObjects(ObjectObjectUnaryOperator<T,V> mappingFunction)
mappingFunction - operation to replace all valuesV compute(T key, ObjectObjectUnaryOperator<T,V> mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the valueV computeIfAbsent(T key, UnaryOperator<T,V> mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if not presentV supplyIfAbsent(T key, ObjectSupplier<V> valueProvider)
key - the key that should be computedvalueProvider - the value if not presentV computeIfPresent(T key, ObjectObjectUnaryOperator<T,V> mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if presentV merge(T key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuevoid mergeAll(Object2ObjectMap<T,V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuedefault V apply(T key)
UnaryOperatorV getObject(T key)
key - the key that is searched fordefault void replaceAll(java.util.function.BiFunction<? super T,? super V,? extends V> mappingFunction)
default V compute(T key, java.util.function.BiFunction<? super T,? super V,? extends V> mappingFunction)
default V computeIfAbsent(T key, java.util.function.Function<? super T,? extends V> mappingFunction)
default V computeIfPresent(T key, java.util.function.BiFunction<? super T,? super V,? extends V> mappingFunction)
default V merge(T key, V value, java.util.function.BiFunction<? super V,? super V,? extends V> mappingFunction)
void forEach(ObjectObjectConsumer<T,V> action)
action - processor of the values that are iterator overObjectCollection<V> values()
ObjectSet<Object2ObjectMap.Entry<T,V>> object2ObjectEntrySet()
default Object2ObjectMap<T,V> synchronize()
Object2ObjectMaps.synchronize(speiger.src.collections.objects.maps.interfaces.Object2ObjectMap<T, V>)default Object2ObjectMap<T,V> synchronize(java.lang.Object mutex)
mutex - is the controller of the synchronization blockObject2ObjectMaps.synchronize(speiger.src.collections.objects.maps.interfaces.Object2ObjectMap<T, V>)default Object2ObjectMap<T,V> unmodifiable()
Object2ObjectMaps.unmodifiable(speiger.src.collections.objects.maps.interfaces.Object2ObjectMap<T, V>)