T - the keyType of elements maintained by this Collectionpublic class Enum2ByteMap<T extends java.lang.Enum<T>> extends AbstractObject2ByteMap<T>
AbstractObject2ByteMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2ByteMap.BuilderCache<T>, Object2ByteMap.Entry<T>, Object2ByteMap.FastEntrySet<T>, Object2ByteMap.MapBuilder| Constructor and Description |
|---|
Enum2ByteMap(java.lang.Class<T> keyType)
Default Constructor
|
Enum2ByteMap(java.util.Map<? extends T,? extends java.lang.Byte> map)
A Helper constructor that allows to create a EnumMap with exactly the same values as the provided map.
|
Enum2ByteMap(Object2ByteMap<T> map)
A Type Specific Helper function that allows to create a new EnumMap with exactly the same values as the provided map.
|
Enum2ByteMap(T[] keys,
byte[] values)
Helper constructor that allow to create a EnumMap from unboxed values
|
Enum2ByteMap(T[] keys,
java.lang.Byte[] values)
Helper constructor that allow to create a EnumMap from boxed values (it will unbox them)
|
| Modifier and Type | Method and Description |
|---|---|
byte |
addTo(T key,
byte value)
A Helper method to add a primitives together.
|
void |
clear() |
byte |
computeByte(T key,
ObjectByteUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
byte |
computeByteIfAbsent(T key,
ToByteFunction<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
byte |
computeByteIfPresent(T key,
ObjectByteUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(byte value)
Type Specific method to reduce boxing/unboxing of values
|
Enum2ByteMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(ObjectByteConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
byte |
getByte(T key)
A Type Specific get method to reduce boxing/unboxing
|
byte |
getOrDefault(T key,
byte defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<T> |
keySet() |
void |
mergeAllByte(Object2ByteMap<T> m,
ByteByteUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
byte |
mergeByte(T key,
byte value,
ByteByteUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
ObjectSet<Object2ByteMap.Entry<T>> |
object2ByteEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
byte |
put(T key,
byte value)
Type Specific method to reduce boxing/unboxing of values
|
byte |
putIfAbsent(T key,
byte value)
Type Specific method to reduce boxing/unboxing of values
|
byte |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
byte |
remOrDefault(T key,
byte defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
java.lang.Byte |
remove(java.lang.Object key) |
boolean |
remove(T key,
byte value)
Type Specific remove function to reduce boxing/unboxing
|
byte |
replace(T key,
byte value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
byte oldValue,
byte newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
byte |
subFrom(T key,
byte value)
A Helper method to subtract from primitive from each other.
|
byte |
supplyByteIfAbsent(T key,
ByteSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ByteCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceBytes, replaceBytes, setDefaultReturnValueapplyAsByte, builder, compute, computeIfAbsent, computeIfPresent, containsValue, forEach, merge, put, put, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic Enum2ByteMap(java.lang.Class<T> keyType)
keyType - the type of Enum that should be usedpublic Enum2ByteMap(T[] keys, java.lang.Byte[] values)
keys - the keys that should be put into the EnumMapvalues - the values that should be put into the EnumMap.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Enum2ByteMap(T[] keys, byte[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Enum2ByteMap(java.util.Map<? extends T,? extends java.lang.Byte> map)
map - the values that should be present in the mappublic Enum2ByteMap(Object2ByteMap<T> map)
map - the values that should be present in the mappublic byte put(T key, byte value)
Object2ByteMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public byte putIfAbsent(T key, byte value)
Object2ByteMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public byte addTo(T key, byte value)
Object2ByteMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic byte subFrom(T key, byte value)
Object2ByteMapObject2ByteMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedkey - that should be subtract fromvalue - that should be subtractpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Byte>containsKey in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>public boolean containsValue(byte value)
Object2ByteMapcontainsValue in interface Object2ByteMap<T extends java.lang.Enum<T>>containsValue in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>value - element that is searched forpublic java.lang.Byte remove(java.lang.Object key)
remove in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Byte>remove in interface Object2ByteMap<T extends java.lang.Enum<T>>remove in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the element that should be removedMap.remove(Object)public byte rem(T key)
Object2ByteMapkey - the element that should be removedpublic byte remOrDefault(T key, byte defaultValue)
Object2ByteMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(T key, byte value)
Object2ByteMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public byte getByte(T key)
Object2ByteMapkey - the key that is searched forpublic byte getOrDefault(T key, byte defaultValue)
Object2ByteMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Enum2ByteMap<T> copy()
Object2ByteMapcopy in interface Object2ByteMap<T extends java.lang.Enum<T>>copy in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>public ObjectSet<Object2ByteMap.Entry<T>> object2ByteEntrySet()
Object2ByteMappublic ObjectSet<T> keySet()
keySet in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Byte>keySet in interface Object2ByteMap<T extends java.lang.Enum<T>>keySet in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>public ByteCollection values()
values in interface java.util.Map<T extends java.lang.Enum<T>,java.lang.Byte>values in interface Object2ByteMap<T extends java.lang.Enum<T>>values in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>public void forEach(ObjectByteConsumer<T> action)
Object2ByteMapforEach in interface Object2ByteMap<T extends java.lang.Enum<T>>forEach in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>action - processor of the values that are iterator overpublic boolean replace(T key, byte oldValue, byte newValue)
Object2ByteMapreplace in interface Object2ByteMap<T extends java.lang.Enum<T>>replace in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public byte replace(T key, byte value)
Object2ByteMapreplace in interface Object2ByteMap<T extends java.lang.Enum<T>>replace in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the element that should be searched forvalue - the value to replace with.public byte computeByte(T key, ObjectByteUnaryOperator<T> mappingFunction)
Object2ByteMapcomputeByte in interface Object2ByteMap<T extends java.lang.Enum<T>>computeByte in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic byte computeByteIfAbsent(T key, ToByteFunction<T> mappingFunction)
Object2ByteMapcomputeByteIfAbsent in interface Object2ByteMap<T extends java.lang.Enum<T>>computeByteIfAbsent in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic byte supplyByteIfAbsent(T key, ByteSupplier valueProvider)
Object2ByteMapsupplyByteIfAbsent in interface Object2ByteMap<T extends java.lang.Enum<T>>supplyByteIfAbsent in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the key that should be computedvalueProvider - the value if not presentpublic byte computeByteIfPresent(T key, ObjectByteUnaryOperator<T> mappingFunction)
Object2ByteMapcomputeByteIfPresent in interface Object2ByteMap<T extends java.lang.Enum<T>>computeByteIfPresent in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic byte mergeByte(T key, byte value, ByteByteUnaryOperator mappingFunction)
Object2ByteMapmergeByte in interface Object2ByteMap<T extends java.lang.Enum<T>>mergeByte in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllByte(Object2ByteMap<T> m, ByteByteUnaryOperator mappingFunction)
Object2ByteMapmergeAllByte in interface Object2ByteMap<T extends java.lang.Enum<T>>mergeAllByte in class AbstractObject2ByteMap<T extends java.lang.Enum<T>>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void clear()