V - the type of elements maintained by this Collectionpublic class Byte2ObjectArrayMap<V> extends AbstractByte2ObjectMap<V> implements Byte2ObjectSortedMap<V>
AbstractByte2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Byte2ObjectSortedMap.FastSortedSet<V>Byte2ObjectMap.Entry<V>, Byte2ObjectMap.FastEntrySet<V>| Constructor and Description |
|---|
Byte2ObjectArrayMap()
Default Constructor
|
Byte2ObjectArrayMap(byte[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Byte2ObjectArrayMap(java.lang.Byte[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Byte2ObjectArrayMap(byte[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Byte2ObjectArrayMap(java.lang.Byte[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Byte2ObjectArrayMap(Byte2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Byte2ObjectArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Byte2ObjectArrayMap(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.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectSortedSet<Byte2ObjectMap.Entry<V>> |
byte2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
clear() |
ByteComparator |
comparator() |
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) |
boolean |
containsValue(java.lang.Object value) |
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 |
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 |
getObject(byte key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(byte key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Byte2ObjectSortedMap<V> |
headMap(byte toKey)
A Type Specific HeadMap method to reduce boxing/unboxing
|
ByteSet |
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 |
remByte(byte key)
Type Specific remove function to reduce boxing/unboxing
|
V |
remByteOrDefault(byte key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(byte key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
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() |
Byte2ObjectSortedMap<V> |
subMap(byte fromKey,
byte toKey)
A Type Specific SubMap method to reduce boxing/unboxing
|
Byte2ObjectSortedMap<V> |
tailMap(byte fromKey)
A Type Specific TailMap method to reduce boxing/unboxing
|
ObjectCollection<V> |
values() |
entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuefirstKey, headMap, lastKey, subMap, tailMapcompute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic Byte2ObjectArrayMap()
public Byte2ObjectArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Byte2ObjectArrayMap(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 lengthpublic Byte2ObjectArrayMap(java.lang.Byte[] keys,
V[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lengthpublic Byte2ObjectArrayMap(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 Byte2ObjectArrayMap(byte[] keys,
V[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Byte2ObjectArrayMap(java.util.Map<? extends java.lang.Byte,? extends V> map)
map - the values that should be present in the mappublic Byte2ObjectArrayMap(Byte2ObjectMap<V> map)
map - the values that should be present in the mappublic 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)
Byte2ObjectSortedMapputAndMoveToFirst in interface Byte2ObjectSortedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(byte key, V value)
Byte2ObjectSortedMapputAndMoveToLast in interface Byte2ObjectSortedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(byte key)
Byte2ObjectSortedMapmoveToFirst in interface Byte2ObjectSortedMap<V>key - that should be moved to the first indexpublic boolean moveToLast(byte key)
Byte2ObjectSortedMapmoveToLast in interface Byte2ObjectSortedMap<V>key - that should be moved to the first lastpublic boolean containsKey(byte key)
Byte2ObjectMapcontainsKey in interface Byte2ObjectMap<V>containsKey in class AbstractByte2ObjectMap<V>key - element that is searched forpublic 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 getObject(byte key)
Byte2ObjectMapgetObject in interface Byte2ObjectFunction<V>getObject in interface Byte2ObjectMap<V>key - the key that is searched forpublic 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 V getAndMoveToFirst(byte key)
Byte2ObjectSortedMapgetAndMoveToFirst in interface Byte2ObjectSortedMap<V>key - that is searched forpublic V getAndMoveToLast(byte key)
Byte2ObjectSortedMapgetAndMoveToLast in interface Byte2ObjectSortedMap<V>key - that is searched forpublic byte firstByteKey()
Byte2ObjectSortedMapfirstByteKey in interface Byte2ObjectSortedMap<V>public byte lastByteKey()
Byte2ObjectSortedMaplastByteKey in interface Byte2ObjectSortedMap<V>public V firstValue()
Byte2ObjectSortedMapfirstValue in interface Byte2ObjectSortedMap<V>public V lastValue()
Byte2ObjectSortedMaplastValue in interface Byte2ObjectSortedMap<V>public byte pollFirstByteKey()
Byte2ObjectSortedMappollFirstByteKey in interface Byte2ObjectSortedMap<V>public byte pollLastByteKey()
Byte2ObjectSortedMappollLastByteKey in interface Byte2ObjectSortedMap<V>public V remByte(byte key)
Byte2ObjectMapremByte in interface Byte2ObjectMap<V>key - the element that should be removedpublic V remByteOrDefault(byte key, V defaultValue)
Byte2ObjectMapremByteOrDefault 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)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 V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Byte,V>remove in interface Byte2ObjectMap<V>remove in class java.util.AbstractMap<java.lang.Byte,V>key - the element that should be removedMap.remove(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 void forEach(ByteObjectConsumer<V> action)
Byte2ObjectMapforEach in interface Byte2ObjectMap<V>forEach in class AbstractByte2ObjectMap<V>action - processor of the values that are iterator overpublic ByteSet keySet()
keySet in interface java.util.Map<java.lang.Byte,V>keySet in interface java.util.SortedMap<java.lang.Byte,V>keySet in interface Byte2ObjectMap<V>keySet in interface Byte2ObjectSortedMap<V>keySet in class AbstractByte2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Byte,V>values in interface java.util.SortedMap<java.lang.Byte,V>values in interface Byte2ObjectMap<V>values in interface Byte2ObjectSortedMap<V>values in class AbstractByte2ObjectMap<V>public ObjectSortedSet<Byte2ObjectMap.Entry<V>> byte2ObjectEntrySet()
Byte2ObjectMapbyte2ObjectEntrySet in interface Byte2ObjectMap<V>public 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 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()
public void clear()
public ByteComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Byte,V>comparator in interface Byte2ObjectSortedMap<V>public Byte2ObjectSortedMap<V> subMap(byte fromKey, byte toKey)
Byte2ObjectSortedMapsubMap in interface Byte2ObjectSortedMap<V>fromKey - where the submap should starttoKey - where the subMap should endpublic Byte2ObjectSortedMap<V> headMap(byte toKey)
Byte2ObjectSortedMapheadMap in interface Byte2ObjectSortedMap<V>toKey - where the headMap should endpublic Byte2ObjectSortedMap<V> tailMap(byte fromKey)
Byte2ObjectSortedMaptailMap in interface Byte2ObjectSortedMap<V>fromKey - where the TailMap should start