V - the type of elements maintained by this Collectionpublic class ImmutableByte2ObjectOpenHashMap<V> extends AbstractByte2ObjectMap<V> implements Byte2ObjectOrderedMap<V>
AbstractByte2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Byte2ObjectOrderedMap.FastOrderedSet<V>Byte2ObjectMap.BuilderCache<V>, Byte2ObjectMap.Entry<V>, Byte2ObjectMap.FastEntrySet<V>, Byte2ObjectMap.MapBuilder| Constructor and Description |
|---|
ImmutableByte2ObjectOpenHashMap(byte[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
ImmutableByte2ObjectOpenHashMap(java.lang.Byte[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
ImmutableByte2ObjectOpenHashMap(byte[] keys,
V[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
ImmutableByte2ObjectOpenHashMap(java.lang.Byte[] keys,
V[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
ImmutableByte2ObjectOpenHashMap(Byte2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
ImmutableByte2ObjectOpenHashMap(Byte2ObjectMap<V> map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
ImmutableByte2ObjectOpenHashMap(java.util.Map<? extends java.lang.Byte,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
ImmutableByte2ObjectOpenHashMap(java.util.Map<? extends java.lang.Byte,? extends V> map,
float loadFactor)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectOrderedSet<Byte2ObjectMap.Entry<V>> |
byte2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
clear() |
V |
compute(byte key,
ByteObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(byte key,
Byte2ObjectFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(byte key,
ByteObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(byte key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsKey(java.lang.Object key)
Deprecated.
|
boolean |
containsValue(java.lang.Object value) |
ImmutableByte2ObjectOpenHashMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
byte |
firstByteKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
void |
forEach(ByteObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(byte key)
A Type Specific get method to reduce boxing/unboxing
|
V |
get(java.lang.Object key) |
V |
getAndMoveToFirst(byte key)
A Specific get method that allows to move teh given key/value int the first index.
|
V |
getAndMoveToLast(byte key)
A Specific get method that allows to move teh given key/value int the last index.
|
V |
getOrDefault(byte key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ByteOrderedSet |
keySet() |
byte |
lastByteKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
V |
merge(byte key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Byte2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
boolean |
moveToFirst(byte key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(byte key)
A specific move method to move a given key/value to the last index.
|
byte |
pollFirstByteKey()
A method to get and remove the first Key of a Map.
|
byte |
pollLastByteKey()
A method to get and remove the last Key of a Map.
|
V |
put(byte key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putAndMoveToFirst(byte key,
V value)
A customized put method that allows you to insert into the first index.
|
V |
putAndMoveToLast(byte key,
V value)
A customized put method that allows you to insert into the last index.
|
V |
putIfAbsent(byte key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(byte key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(byte key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
remove(java.lang.Object key)
Deprecated.
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
removeOrDefault(byte key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
replace(byte key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(byte key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
V |
supplyIfAbsent(byte key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ObjectCollection<V> |
values() |
entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuesynchronize, synchronize, unmodifiablebuilder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic ImmutableByte2ObjectOpenHashMap(java.lang.Byte[] keys,
V[] 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 ImmutableByte2ObjectOpenHashMap(java.lang.Byte[] keys,
V[] values,
float loadFactor)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ImmutableByte2ObjectOpenHashMap(byte[] keys,
V[] 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 ImmutableByte2ObjectOpenHashMap(byte[] keys,
V[] values,
float loadFactor)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ImmutableByte2ObjectOpenHashMap(java.util.Map<? extends java.lang.Byte,? extends V> map)
map - the values that should be present in the mappublic ImmutableByte2ObjectOpenHashMap(java.util.Map<? extends java.lang.Byte,? extends V> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public ImmutableByte2ObjectOpenHashMap(Byte2ObjectMap<V> map)
map - the values that should be present in the mappublic ImmutableByte2ObjectOpenHashMap(Byte2ObjectMap<V> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public V put(byte key, V value)
Byte2ObjectMapput in interface Byte2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(byte key, V value)
Byte2ObjectMapputIfAbsent in interface Byte2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V putAndMoveToFirst(byte key, V value)
Byte2ObjectOrderedMapputAndMoveToFirst in interface Byte2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(byte key, V value)
Byte2ObjectOrderedMapputAndMoveToLast in interface Byte2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(byte key)
Byte2ObjectOrderedMapmoveToFirst in interface Byte2ObjectOrderedMap<V>key - that should be moved to the first indexpublic boolean moveToLast(byte key)
Byte2ObjectOrderedMapmoveToLast in interface Byte2ObjectOrderedMap<V>key - that should be moved to the first lastpublic V getAndMoveToFirst(byte key)
Byte2ObjectOrderedMapgetAndMoveToFirst in interface Byte2ObjectOrderedMap<V>key - that is searched forpublic V getAndMoveToLast(byte key)
Byte2ObjectOrderedMapgetAndMoveToLast in interface Byte2ObjectOrderedMap<V>key - that is searched forpublic boolean containsKey(byte key)
Byte2ObjectMapcontainsKey in interface Byte2ObjectMap<V>containsKey in class AbstractByte2ObjectMap<V>key - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Byte,V>containsKey in interface Byte2ObjectMap<V>containsKey in class java.util.AbstractMap<java.lang.Byte,V>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Byte,V>containsValue in class AbstractByte2ObjectMap<V>public V remove(byte key)
Byte2ObjectMapremove in interface Byte2ObjectMap<V>key - the element that should be removedpublic V removeOrDefault(byte key, V defaultValue)
Byte2ObjectMapremoveOrDefault in interface Byte2ObjectMap<V>key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)@Deprecated public V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Byte,V>remove in interface Byte2ObjectMap<V>remove in class AbstractByte2ObjectMap<V>key - the element that should be removedMap.remove(Object)public boolean remove(byte key,
V value)
Byte2ObjectMapremove in interface Byte2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<java.lang.Byte,V>remove in interface Byte2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public V get(byte key)
Byte2ObjectMapget in interface Byte2ObjectFunction<V>get in interface Byte2ObjectMap<V>key - the key that is searched forpublic V get(java.lang.Object key)
get in interface java.util.Map<java.lang.Byte,V>get in interface Byte2ObjectMap<V>get in class AbstractByte2ObjectMap<V>public V getOrDefault(byte key, V defaultValue)
Byte2ObjectMapgetOrDefault in interface Byte2ObjectMap<V>getOrDefault in class AbstractByte2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic byte firstByteKey()
Byte2ObjectOrderedMapfirstByteKey in interface Byte2ObjectOrderedMap<V>public byte pollFirstByteKey()
Byte2ObjectOrderedMappollFirstByteKey in interface Byte2ObjectOrderedMap<V>public byte lastByteKey()
Byte2ObjectOrderedMaplastByteKey in interface Byte2ObjectOrderedMap<V>public byte pollLastByteKey()
Byte2ObjectOrderedMappollLastByteKey in interface Byte2ObjectOrderedMap<V>public V firstValue()
Byte2ObjectOrderedMapfirstValue in interface Byte2ObjectOrderedMap<V>public V lastValue()
Byte2ObjectOrderedMaplastValue in interface Byte2ObjectOrderedMap<V>public ObjectOrderedSet<Byte2ObjectMap.Entry<V>> byte2ObjectEntrySet()
Byte2ObjectMapbyte2ObjectEntrySet in interface Byte2ObjectMap<V>byte2ObjectEntrySet in interface Byte2ObjectOrderedMap<V>public ByteOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Byte,V>keySet in interface Byte2ObjectMap<V>keySet in interface Byte2ObjectOrderedMap<V>keySet in class AbstractByte2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Byte,V>values in interface Byte2ObjectMap<V>values in class AbstractByte2ObjectMap<V>public ImmutableByte2ObjectOpenHashMap<V> copy()
Byte2ObjectMapcopy in interface Byte2ObjectMap<V>copy in interface Byte2ObjectOrderedMap<V>copy in class AbstractByte2ObjectMap<V>public void forEach(ByteObjectConsumer<V> action)
Byte2ObjectMapforEach in interface Byte2ObjectMap<V>forEach in class AbstractByte2ObjectMap<V>action - processor of the values that are iterator overpublic boolean replace(byte key,
V oldValue,
V newValue)
Byte2ObjectMapreplace in interface Byte2ObjectMap<V>replace in class AbstractByte2ObjectMap<V>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public V replace(byte key, V value)
Byte2ObjectMapreplace in interface Byte2ObjectMap<V>replace in class AbstractByte2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(byte key, ByteObjectUnaryOperator<V> mappingFunction)
Byte2ObjectMapcompute in interface Byte2ObjectMap<V>compute in class AbstractByte2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(byte key, Byte2ObjectFunction<V> mappingFunction)
Byte2ObjectMapcomputeIfAbsent in interface Byte2ObjectMap<V>computeIfAbsent in class AbstractByte2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V supplyIfAbsent(byte key, ObjectSupplier<V> valueProvider)
Byte2ObjectMapsupplyIfAbsent in interface Byte2ObjectMap<V>supplyIfAbsent in class AbstractByte2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(byte key, ByteObjectUnaryOperator<V> mappingFunction)
Byte2ObjectMapcomputeIfPresent in interface Byte2ObjectMap<V>computeIfPresent in class AbstractByte2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(byte key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Byte2ObjectMapmerge in interface Byte2ObjectMap<V>merge in class AbstractByte2ObjectMap<V>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 mergeAll(Byte2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Byte2ObjectMapmergeAll in interface Byte2ObjectMap<V>mergeAll in class AbstractByte2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()