public interface Long2ShortMap extends java.util.Map<java.lang.Long,java.lang.Short>, Long2ShortFunction
| Modifier and Type | Interface and Description |
|---|---|
static class |
Long2ShortMap.BuilderCache
Builder Cache for allowing to buildMaps
|
static interface |
Long2ShortMap.Entry
Type Specific Map Entry that reduces boxing/unboxing
|
static interface |
Long2ShortMap.FastEntrySet
Fast Entry set that allows for a faster Entry Iterator by recycling the Entry Object and just exchanging 1 internal value
|
static class |
Long2ShortMap.MapBuilder
Helper class that reduces the method spam of the Map Class.
|
| Modifier and Type | Method and Description |
|---|---|
short |
addTo(long key,
short value)
A Helper method to add a primitives together.
|
void |
addToAll(Long2ShortMap m)
A Helper method to bulk add primitives together.
|
static Long2ShortMap.MapBuilder |
builder()
Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.
|
default java.lang.Short |
compute(java.lang.Long key,
java.util.function.BiFunction<? super java.lang.Long,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
Deprecated.
|
default java.lang.Short |
computeIfAbsent(java.lang.Long key,
java.util.function.Function<? super java.lang.Long,? extends java.lang.Short> mappingFunction)
Deprecated.
|
default java.lang.Short |
computeIfPresent(java.lang.Long key,
java.util.function.BiFunction<? super java.lang.Long,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
Deprecated.
|
short |
computeShort(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long key)
Type Specific method to reduce boxing/unboxing of values
|
default boolean |
containsKey(java.lang.Object key) |
default boolean |
containsValue(java.lang.Object value) |
boolean |
containsValue(short value)
Type Specific method to reduce boxing/unboxing of values
|
Long2ShortMap |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<java.lang.Long,java.lang.Short>> |
entrySet()
Deprecated.
|
default void |
forEach(java.util.function.BiConsumer<? super java.lang.Long,? super java.lang.Short> action)
Deprecated.
|
void |
forEach(LongShortConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
short |
get(long key)
A Type Specific get method to reduce boxing/unboxing
|
default java.lang.Short |
get(java.lang.Object key)
Deprecated.
|
short |
getDefaultReturnValue()
Method to see what the default return value is.
|
short |
getOrDefault(long key,
short defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
default java.lang.Short |
getOrDefault(java.lang.Object key,
java.lang.Short defaultValue)
Deprecated.
|
LongSet |
keySet() |
ObjectSet<Long2ShortMap.Entry> |
long2ShortEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
default java.lang.Short |
merge(java.lang.Long key,
java.lang.Short value,
java.util.function.BiFunction<? super java.lang.Short,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
Deprecated.
|
void |
mergeAllShort(Long2ShortMap m,
ShortShortUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
short |
mergeShort(long key,
short value,
ShortShortUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
short |
put(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
default java.lang.Short |
put(java.lang.Long key,
java.lang.Short value)
Deprecated.
|
default void |
putAll(long[] keys,
short[] values)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
default void |
putAll(java.lang.Long[] keys,
java.lang.Short[] values)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(long[] 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
|
void |
putAll(java.lang.Long[] keys,
java.lang.Short[] values,
int offset,
int size)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(Long2ShortMap m)
Type Specific function for the bull putting of values
|
void |
putAllIfAbsent(Long2ShortMap m)
Type-Specific bulk put method put elements into the map if not present.
|
short |
putIfAbsent(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
default java.lang.Short |
putIfAbsent(java.lang.Long key,
java.lang.Short value)
Deprecated.
|
short |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long key,
short value)
Type Specific remove function to reduce boxing/unboxing
|
default java.lang.Short |
remove(java.lang.Object key) |
default boolean |
remove(java.lang.Object key,
java.lang.Object value) |
short |
removeOrDefault(long key,
short defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
short |
replace(long key,
short value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
default java.lang.Short |
replace(java.lang.Long key,
java.lang.Short value)
Deprecated.
|
boolean |
replace(long key,
short oldValue,
short newValue)
A Type Specific replace method to replace an existing value
|
default boolean |
replace(java.lang.Long key,
java.lang.Short oldValue,
java.lang.Short newValue)
Deprecated.
|
default void |
replaceAll(java.util.function.BiFunction<? super java.lang.Long,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
Deprecated.
|
void |
replaceShorts(Long2ShortMap m)
Type-Specific bulk replace method.
|
void |
replaceShorts(LongShortUnaryOperator mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
Long2ShortMap |
setDefaultReturnValue(short v)
Method to define the default return value if a requested key isn't present
|
short |
subFrom(long key,
short value)
A Helper method to subtract from primitive from each other.
|
short |
supplyShortIfAbsent(long key,
ShortSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
default Long2ShortMap |
synchronize()
Creates a Wrapped Map that is Synchronized
|
default Long2ShortMap |
synchronize(java.lang.Object mutex)
Creates a Wrapped Map that is Synchronized
|
default Long2ShortMap |
unmodifiable()
Creates a Wrapped Map that is unmodifiable
|
ShortCollection |
values() |
static Long2ShortMap.MapBuilder builder()
short getDefaultReturnValue()
Long2ShortMap setDefaultReturnValue(short v)
v - value that should be the default return valueLong2ShortMap copy()
short put(long key,
short value)
key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)default void putAll(long[] keys,
short[] 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(long[] keys,
short[] 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)default void putAll(java.lang.Long[] keys,
java.lang.Short[] 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(java.lang.Long[] keys,
java.lang.Short[] 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)short putIfAbsent(long key,
short value)
key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)void putAllIfAbsent(Long2ShortMap m)
m - elements that should be added if not present.short addTo(long key,
short value)
key - the key that should be inserted,value - the value that should be inserted / addedvoid addToAll(Long2ShortMap m)
m - the values that should be added/insertedshort subFrom(long key,
short value)
getDefaultReturnValue()
If the fence is reached the element will be automaticall removedkey - that should be subtract fromvalue - that should be subtractvoid putAll(Long2ShortMap m)
m - the elements that should be insertedboolean containsKey(long key)
key - element that is searched fordefault boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Long,java.lang.Short>key - that is searched for.Map.containsKey(Object)boolean containsValue(short value)
value - element that is searched fordefault boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Long,java.lang.Short>value - that is searched for.Map.containsValue(Object)short remove(long key)
key - the element that should be removeddefault java.lang.Short remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Long,java.lang.Short>key - the element that should be removedMap.remove(Object)boolean remove(long key,
short value)
key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)default boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<java.lang.Long,java.lang.Short>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)short removeOrDefault(long key,
short 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(long key,
short oldValue,
short newValue)
key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.short replace(long key,
short value)
key - the element that should be searched forvalue - the value to replace with.void replaceShorts(Long2ShortMap m)
m - elements that should be replaced.void replaceShorts(LongShortUnaryOperator mappingFunction)
mappingFunction - operation to replace all valuesshort computeShort(long key,
LongShortUnaryOperator mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the valueshort computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if not presentshort supplyShortIfAbsent(long key,
ShortSupplier valueProvider)
key - the key that should be computedvalueProvider - the value if not presentshort computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if presentshort mergeShort(long key,
short value,
ShortShortUnaryOperator 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 mergeAllShort(Long2ShortMap m, ShortShortUnaryOperator mappingFunction)
m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Value@Deprecated
default boolean replace(java.lang.Long key,
java.lang.Short oldValue,
java.lang.Short newValue)
replace in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated
default java.lang.Short replace(java.lang.Long key,
java.lang.Short value)
replace in interface java.util.Map<java.lang.Long,java.lang.Short>short get(long key)
get in interface Long2ShortFunctionkey - the key that is searched forshort getOrDefault(long key,
short defaultValue)
key - the key that is searched fordefaultValue - the value that should be returned if the key is not present@Deprecated default java.lang.Short get(java.lang.Object key)
get in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated
default java.lang.Short getOrDefault(java.lang.Object key,
java.lang.Short defaultValue)
getOrDefault in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated default void replaceAll(java.util.function.BiFunction<? super java.lang.Long,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
replaceAll in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated
default java.lang.Short compute(java.lang.Long key,
java.util.function.BiFunction<? super java.lang.Long,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
compute in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated
default java.lang.Short computeIfAbsent(java.lang.Long key,
java.util.function.Function<? super java.lang.Long,? extends java.lang.Short> mappingFunction)
computeIfAbsent in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated
default java.lang.Short computeIfPresent(java.lang.Long key,
java.util.function.BiFunction<? super java.lang.Long,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
computeIfPresent in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated
default java.lang.Short merge(java.lang.Long key,
java.lang.Short value,
java.util.function.BiFunction<? super java.lang.Short,? super java.lang.Short,? extends java.lang.Short> mappingFunction)
merge in interface java.util.Map<java.lang.Long,java.lang.Short>void forEach(LongShortConsumer action)
action - processor of the values that are iterator over@Deprecated default void forEach(java.util.function.BiConsumer<? super java.lang.Long,? super java.lang.Short> action)
forEach in interface java.util.Map<java.lang.Long,java.lang.Short>LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Short>ShortCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated ObjectSet<java.util.Map.Entry<java.lang.Long,java.lang.Short>> entrySet()
entrySet in interface java.util.Map<java.lang.Long,java.lang.Short>ObjectSet<Long2ShortMap.Entry> long2ShortEntrySet()
default Long2ShortMap synchronize()
Long2ShortMaps.synchronize(speiger.src.collections.longs.maps.interfaces.Long2ShortMap)default Long2ShortMap synchronize(java.lang.Object mutex)
mutex - is the controller of the synchronization blockLong2ShortMaps.synchronize(speiger.src.collections.longs.maps.interfaces.Long2ShortMap)default Long2ShortMap unmodifiable()
Long2ShortMaps.unmodifiable(speiger.src.collections.longs.maps.interfaces.Long2ShortMap)@Deprecated
default java.lang.Short put(java.lang.Long key,
java.lang.Short value)
put in interface java.util.Map<java.lang.Long,java.lang.Short>@Deprecated
default java.lang.Short putIfAbsent(java.lang.Long key,
java.lang.Short value)
putIfAbsent in interface java.util.Map<java.lang.Long,java.lang.Short>