public interface Byte2IntMap extends java.util.Map<java.lang.Byte,java.lang.Integer>, Byte2IntFunction
| Modifier and Type | Interface and Description |
|---|---|
static class |
Byte2IntMap.BuilderCache
Builder Cache for allowing to buildMaps
|
static interface |
Byte2IntMap.Entry
Type Specific Map Entry that reduces boxing/unboxing
|
static interface |
Byte2IntMap.FastEntrySet
Fast Entry set that allows for a faster Entry Iterator by recycling the Entry Object and just exchanging 1 internal value
|
static class |
Byte2IntMap.MapBuilder
Helper class that reduces the method spam of the Map Class.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addTo(byte key,
int value)
A Helper method to add a primitives together.
|
void |
addToAll(Byte2IntMap m)
A Helper method to bulk add primitives together.
|
default int |
applyAsInt(byte key)
Type Specific get function to reduce boxing/unboxing
|
static Byte2IntMap.MapBuilder |
builder()
Helper Class that allows to create Maps without requiring a to type out the entire implementation or know it.
|
ObjectSet<Byte2IntMap.Entry> |
byte2IntEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
default java.lang.Integer |
compute(java.lang.Byte key,
java.util.function.BiFunction<? super java.lang.Byte,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
Deprecated.
|
default java.lang.Integer |
computeIfAbsent(java.lang.Byte key,
java.util.function.Function<? super java.lang.Byte,? extends java.lang.Integer> mappingFunction)
Deprecated.
|
default java.lang.Integer |
computeIfPresent(java.lang.Byte key,
java.util.function.BiFunction<? super java.lang.Byte,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
Deprecated.
|
int |
computeInt(byte key,
ByteIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfAbsent(byte key,
Byte2IntFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfPresent(byte key,
ByteIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(byte key)
Type Specific method to reduce boxing/unboxing of values
|
default boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(int value)
Type Specific method to reduce boxing/unboxing of values
|
default boolean |
containsValue(java.lang.Object value) |
Byte2IntMap |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<java.lang.Byte,java.lang.Integer>> |
entrySet()
Deprecated.
|
default void |
forEach(java.util.function.BiConsumer<? super java.lang.Byte,? super java.lang.Integer> action)
Deprecated.
|
void |
forEach(ByteIntConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
int |
get(byte key)
A Type Specific get method to reduce boxing/unboxing
|
default java.lang.Integer |
get(java.lang.Object key)
Deprecated.
|
int |
getDefaultReturnValue()
Method to see what the default return value is.
|
int |
getOrDefault(byte key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
default java.lang.Integer |
getOrDefault(java.lang.Object key,
java.lang.Integer defaultValue)
Deprecated.
|
ByteSet |
keySet() |
default java.lang.Integer |
merge(java.lang.Byte key,
java.lang.Integer value,
java.util.function.BiFunction<? super java.lang.Integer,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
Deprecated.
|
void |
mergeAllInt(Byte2IntMap m,
IntIntUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
int |
mergeInt(byte key,
int value,
IntIntUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
default int |
put(Byte2IntMap.Entry entry)
A Helper method that allows to put int a Byte2IntMap.Entry into a map.
|
int |
put(byte key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
default java.lang.Integer |
put(java.lang.Byte key,
java.lang.Integer value)
Deprecated.
|
default java.lang.Integer |
put(java.util.Map.Entry<java.lang.Byte,java.lang.Integer> entry)
A Helper method that allows to put int a Map.Entry into a map.
|
default void |
putAll(byte[] keys,
int[] values)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(byte[] keys,
int[] values,
int offset,
int size)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
default void |
putAll(java.lang.Byte[] keys,
java.lang.Integer[] values)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(java.lang.Byte[] keys,
java.lang.Integer[] 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(Byte2IntMap m)
Type Specific function for the bull putting of values
|
void |
putAllIfAbsent(Byte2IntMap m)
Type-Specific bulk put method put elements into the map if not present.
|
int |
putIfAbsent(byte key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
default java.lang.Integer |
putIfAbsent(java.lang.Byte key,
java.lang.Integer value)
Deprecated.
|
int |
remove(byte key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(byte key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
default java.lang.Integer |
remove(java.lang.Object key) |
default boolean |
remove(java.lang.Object key,
java.lang.Object value) |
int |
removeOrDefault(byte key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
int |
replace(byte key,
int value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
default java.lang.Integer |
replace(java.lang.Byte key,
java.lang.Integer value)
Deprecated.
|
default boolean |
replace(java.lang.Byte key,
java.lang.Integer oldValue,
java.lang.Integer newValue)
Deprecated.
|
boolean |
replace(byte key,
int oldValue,
int newValue)
A Type Specific replace method to replace an existing value
|
default void |
replaceAll(java.util.function.BiFunction<? super java.lang.Byte,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
Deprecated.
|
void |
replaceInts(Byte2IntMap m)
Type-Specific bulk replace method.
|
void |
replaceInts(ByteIntUnaryOperator mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
Byte2IntMap |
setDefaultReturnValue(int v)
Method to define the default return value if a requested key isn't present
|
int |
subFrom(byte key,
int value)
A Helper method to subtract from primitive from each other.
|
int |
supplyIntIfAbsent(byte key,
IntSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
default Byte2IntMap |
synchronize()
Creates a Wrapped Map that is Synchronized
|
default Byte2IntMap |
synchronize(java.lang.Object mutex)
Creates a Wrapped Map that is Synchronized
|
default Byte2IntMap |
unmodifiable()
Creates a Wrapped Map that is unmodifiable
|
IntCollection |
values() |
static Byte2IntMap.MapBuilder builder()
int getDefaultReturnValue()
Byte2IntMap setDefaultReturnValue(int v)
v - value that should be the default return valueByte2IntMap copy()
int put(byte key,
int value)
key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)default int put(Byte2IntMap.Entry entry)
entry - then Entry that should be inserted.default java.lang.Integer put(java.util.Map.Entry<java.lang.Byte,java.lang.Integer> entry)
entry - then Entry that should be inserted.default void putAll(byte[] keys,
int[] 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(byte[] keys,
int[] 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.Byte[] keys,
java.lang.Integer[] 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.Byte[] keys,
java.lang.Integer[] 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)int putIfAbsent(byte key,
int value)
key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)void putAllIfAbsent(Byte2IntMap m)
m - elements that should be added if not present.int addTo(byte key,
int value)
key - the key that should be inserted,value - the value that should be inserted / addedvoid addToAll(Byte2IntMap m)
m - the values that should be added/insertedint subFrom(byte key,
int value)
getDefaultReturnValue()
If the fence is reached the element will be automaticall removedkey - that should be subtract fromvalue - that should be subtractvoid putAll(Byte2IntMap m)
m - the elements that should be insertedboolean containsKey(byte key)
key - element that is searched fordefault boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Byte,java.lang.Integer>key - that is searched for.Map.containsKey(Object)boolean containsValue(int value)
value - element that is searched fordefault boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Byte,java.lang.Integer>value - that is searched for.Map.containsValue(Object)int remove(byte key)
key - the element that should be removeddefault java.lang.Integer remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Byte,java.lang.Integer>key - the element that should be removedMap.remove(Object)boolean remove(byte key,
int 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.Byte,java.lang.Integer>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)int removeOrDefault(byte key,
int 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(byte key,
int oldValue,
int newValue)
key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.int replace(byte key,
int value)
key - the element that should be searched forvalue - the value to replace with.void replaceInts(Byte2IntMap m)
m - elements that should be replaced.void replaceInts(ByteIntUnaryOperator mappingFunction)
mappingFunction - operation to replace all valuesint computeInt(byte key,
ByteIntUnaryOperator mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the valueint computeIntIfAbsent(byte key,
Byte2IntFunction mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if not presentint supplyIntIfAbsent(byte key,
IntSupplier valueProvider)
key - the key that should be computedvalueProvider - the value if not presentint computeIntIfPresent(byte key,
ByteIntUnaryOperator mappingFunction)
key - the key that should be computedmappingFunction - the operator that should generate the value if presentint mergeInt(byte key,
int value,
IntIntUnaryOperator 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 mergeAllInt(Byte2IntMap m, IntIntUnaryOperator mappingFunction)
m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Value@Deprecated
default boolean replace(java.lang.Byte key,
java.lang.Integer oldValue,
java.lang.Integer newValue)
replace in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated
default java.lang.Integer replace(java.lang.Byte key,
java.lang.Integer value)
replace in interface java.util.Map<java.lang.Byte,java.lang.Integer>default int applyAsInt(byte key)
Byte2IntFunctionapplyAsInt in interface Byte2IntFunctionkey - the value that should be processedint get(byte key)
key - the key that is searched forint getOrDefault(byte key,
int defaultValue)
key - the key that is searched fordefaultValue - the value that should be returned if the key is not present@Deprecated default java.lang.Integer get(java.lang.Object key)
get in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated
default java.lang.Integer getOrDefault(java.lang.Object key,
java.lang.Integer defaultValue)
getOrDefault in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated default void replaceAll(java.util.function.BiFunction<? super java.lang.Byte,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
replaceAll in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated
default java.lang.Integer compute(java.lang.Byte key,
java.util.function.BiFunction<? super java.lang.Byte,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
compute in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated
default java.lang.Integer computeIfAbsent(java.lang.Byte key,
java.util.function.Function<? super java.lang.Byte,? extends java.lang.Integer> mappingFunction)
computeIfAbsent in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated
default java.lang.Integer computeIfPresent(java.lang.Byte key,
java.util.function.BiFunction<? super java.lang.Byte,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
computeIfPresent in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated
default java.lang.Integer merge(java.lang.Byte key,
java.lang.Integer value,
java.util.function.BiFunction<? super java.lang.Integer,? super java.lang.Integer,? extends java.lang.Integer> mappingFunction)
merge in interface java.util.Map<java.lang.Byte,java.lang.Integer>void forEach(ByteIntConsumer action)
action - processor of the values that are iterator over@Deprecated default void forEach(java.util.function.BiConsumer<? super java.lang.Byte,? super java.lang.Integer> action)
forEach in interface java.util.Map<java.lang.Byte,java.lang.Integer>ByteSet keySet()
keySet in interface java.util.Map<java.lang.Byte,java.lang.Integer>IntCollection values()
values in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated ObjectSet<java.util.Map.Entry<java.lang.Byte,java.lang.Integer>> entrySet()
entrySet in interface java.util.Map<java.lang.Byte,java.lang.Integer>ObjectSet<Byte2IntMap.Entry> byte2IntEntrySet()
default Byte2IntMap synchronize()
Byte2IntMaps.synchronize(speiger.src.collections.bytes.maps.interfaces.Byte2IntMap)default Byte2IntMap synchronize(java.lang.Object mutex)
mutex - is the controller of the synchronization blockByte2IntMaps.synchronize(speiger.src.collections.bytes.maps.interfaces.Byte2IntMap)default Byte2IntMap unmodifiable()
Byte2IntMaps.unmodifiable(speiger.src.collections.bytes.maps.interfaces.Byte2IntMap)@Deprecated
default java.lang.Integer put(java.lang.Byte key,
java.lang.Integer value)
put in interface java.util.Map<java.lang.Byte,java.lang.Integer>@Deprecated
default java.lang.Integer putIfAbsent(java.lang.Byte key,
java.lang.Integer value)
putIfAbsent in interface java.util.Map<java.lang.Byte,java.lang.Integer>