V - the keyType of elements maintained by this Collectionpublic class Byte2ObjectRBTreeMap<V> extends AbstractByte2ObjectMap<V> implements Byte2ObjectNavigableMap<V>
AbstractByte2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Byte2ObjectSortedMap.FastSortedSet<V>Byte2ObjectMap.BuilderCache<V>, Byte2ObjectMap.Entry<V>, Byte2ObjectMap.FastEntrySet<V>, Byte2ObjectMap.MapBuilder| Constructor and Description |
|---|
Byte2ObjectRBTreeMap()
Default Constructor
|
Byte2ObjectRBTreeMap(byte[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Byte2ObjectRBTreeMap(java.lang.Byte[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Byte2ObjectRBTreeMap(byte[] keys,
V[] values,
ByteComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Byte2ObjectRBTreeMap(java.lang.Byte[] keys,
V[] values,
ByteComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Byte2ObjectRBTreeMap(Byte2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Byte2ObjectRBTreeMap(Byte2ObjectMap<V> map,
ByteComparator comp)
A Type Specific Helper function that has a custom sorter and allows to create a new Map with exactly the same values as the provided map.
|
Byte2ObjectRBTreeMap(ByteComparator comp)
Constructor that allows to define the sorter
|
Byte2ObjectRBTreeMap(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.
|
Byte2ObjectRBTreeMap(java.util.Map<? extends java.lang.Byte,? extends V> map,
ByteComparator comp)
A Helper constructor that has a custom sorter and allows to create a Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectSet<Byte2ObjectMap.Entry<V>> |
byte2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Byte2ObjectMap.Entry<V> |
ceilingEntry(byte key)
A Type Specific ceilingEntry method to reduce boxing/unboxing.
|
byte |
ceilingKey(byte e)
A Type Specific ceilingKey method to reduce boxing/unboxing.
|
void |
clear() |
ByteComparator |
comparator() |
V |
compute(byte key,
ByteObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(byte key,
ByteFunction<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
|
Byte2ObjectRBTreeMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
ByteNavigableSet |
descendingKeySet() |
Byte2ObjectNavigableMap<V> |
descendingMap() |
byte |
firstByteKey()
A method to get the first Key of a Map.
|
Byte2ObjectMap.Entry<V> |
firstEntry() |
V |
firstValue()
A method to get the first Value of a Map.
|
Byte2ObjectMap.Entry<V> |
floorEntry(byte key)
A Type Specific floorEntry method to reduce boxing/unboxing.
|
byte |
floorKey(byte e)
A Type Specific floorKey method to reduce boxing/unboxing.
|
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
|
byte |
getDefaultMaxValue()
A Helper method to get the max value for SubMaps.
|
byte |
getDefaultMinValue()
A Helper method to get the min value for SubMaps.
|
V |
getOrDefault(byte key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Byte2ObjectNavigableMap<V> |
headMap(byte toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Byte2ObjectMap.Entry<V> |
higherEntry(byte key)
A Type Specific higherEntry method to reduce boxing/unboxing.
|
byte |
higherKey(byte e)
A Type Specific higherKey method to reduce boxing/unboxing.
|
ByteNavigableSet |
keySet() |
byte |
lastByteKey()
A method to get the last Key of a Map.
|
Byte2ObjectMap.Entry<V> |
lastEntry() |
V |
lastValue()
A method to get the last Value of a Map.
|
Byte2ObjectMap.Entry<V> |
lowerEntry(byte key)
A Type Specific lowerEntry method to reduce boxing/unboxing.
|
byte |
lowerKey(byte e)
A Type Specific lowerKey method to reduce boxing/unboxing.
|
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.
|
ByteNavigableSet |
navigableKeySet() |
byte |
pollFirstByteKey()
A method to get and remove the first Key of a Map.
|
Byte2ObjectMap.Entry<V> |
pollFirstEntry() |
byte |
pollLastByteKey()
A method to get and remove the last Key of a Map.
|
Byte2ObjectMap.Entry<V> |
pollLastEntry() |
V |
put(byte key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
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 |
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
|
void |
setDefaultMaxValue(byte value)
A Helper method to set the max value for SubMaps.
|
void |
setDefaultMinValue(byte value)
A Helper method to set the min value for SubMaps.
|
int |
size() |
Byte2ObjectNavigableMap<V> |
subMap(byte fromKey,
boolean fromInclusive,
byte toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
V |
supplyIfAbsent(byte key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Byte2ObjectNavigableMap<V> |
tailMap(byte fromKey,
boolean inclusive)
A Type Specific TailMap method to reduce boxing/unboxing
|
ObjectCollection<V> |
values() |
containsValue, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceObjects, replaceObjects, setDefaultReturnValueceilingEntry, ceilingKey, floorEntry, floorKey, headMap, headMap, headMap, higherEntry, higherKey, lowerEntry, lowerKey, subMap, subMap, subMap, synchronize, synchronize, tailMap, tailMap, tailMap, unmodifiablefirstKey, lastKeyapply, builder, compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, remove, remove, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic Byte2ObjectRBTreeMap()
public Byte2ObjectRBTreeMap(ByteComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Byte2ObjectRBTreeMap(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 Byte2ObjectRBTreeMap(java.lang.Byte[] keys,
V[] values,
ByteComparator comp)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.comp - the function that decides how the tree is sorted, can be nulljava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Byte2ObjectRBTreeMap(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 Byte2ObjectRBTreeMap(byte[] keys,
V[] values,
ByteComparator comp)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.comp - the function that decides how the tree is sorted, can be nulljava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Byte2ObjectRBTreeMap(java.util.Map<? extends java.lang.Byte,? extends V> map)
map - the values that should be present in the mappublic Byte2ObjectRBTreeMap(java.util.Map<? extends java.lang.Byte,? extends V> map, ByteComparator comp)
map - the values that should be present in the mapcomp - the function that decides how the tree is sorted, can be nullpublic Byte2ObjectRBTreeMap(Byte2ObjectMap<V> map)
map - the values that should be present in the mappublic Byte2ObjectRBTreeMap(Byte2ObjectMap<V> map, ByteComparator comp)
map - the values that should be present in the mapcomp - the function that decides how the tree is sorted, can be nullpublic void setDefaultMaxValue(byte value)
Byte2ObjectNavigableMapsetDefaultMaxValue in interface Byte2ObjectNavigableMap<V>value - the new max valuepublic byte getDefaultMaxValue()
Byte2ObjectNavigableMapgetDefaultMaxValue in interface Byte2ObjectNavigableMap<V>public void setDefaultMinValue(byte value)
Byte2ObjectNavigableMapsetDefaultMinValue in interface Byte2ObjectNavigableMap<V>value - the new min valuepublic byte getDefaultMinValue()
Byte2ObjectNavigableMapgetDefaultMinValue in interface Byte2ObjectNavigableMap<V>public 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 ByteComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Byte,V>comparator in interface Byte2ObjectSortedMap<V>public boolean containsKey(byte key)
Byte2ObjectMapcontainsKey in interface Byte2ObjectMap<V>containsKey in class AbstractByte2ObjectMap<V>key - element that is searched forpublic V get(byte key)
Byte2ObjectMapget 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 byte firstByteKey()
Byte2ObjectSortedMapfirstByteKey in interface Byte2ObjectSortedMap<V>public byte pollFirstByteKey()
Byte2ObjectSortedMappollFirstByteKey in interface Byte2ObjectSortedMap<V>public byte lastByteKey()
Byte2ObjectSortedMaplastByteKey in interface Byte2ObjectSortedMap<V>public byte pollLastByteKey()
Byte2ObjectSortedMappollLastByteKey in interface Byte2ObjectSortedMap<V>public Byte2ObjectMap.Entry<V> firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Byte,V>firstEntry in interface Byte2ObjectNavigableMap<V>public Byte2ObjectMap.Entry<V> lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Byte,V>lastEntry in interface Byte2ObjectNavigableMap<V>public Byte2ObjectMap.Entry<V> pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Byte,V>pollFirstEntry in interface Byte2ObjectNavigableMap<V>public Byte2ObjectMap.Entry<V> pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Byte,V>pollLastEntry in interface Byte2ObjectNavigableMap<V>public V firstValue()
Byte2ObjectSortedMapfirstValue in interface Byte2ObjectSortedMap<V>public V lastValue()
Byte2ObjectSortedMaplastValue in interface Byte2ObjectSortedMap<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)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 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, ByteFunction<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 void forEach(ByteObjectConsumer<V> action)
Byte2ObjectMapforEach in interface Byte2ObjectMap<V>forEach in class AbstractByte2ObjectMap<V>action - processor of the values that are iterator overpublic int size()
public void clear()
public Byte2ObjectRBTreeMap<V> copy()
Byte2ObjectMapcopy in interface Byte2ObjectMap<V>copy in interface Byte2ObjectNavigableMap<V>copy in interface Byte2ObjectSortedMap<V>copy in class AbstractByte2ObjectMap<V>public ByteNavigableSet 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 Byte2ObjectNavigableMap<V>keySet in interface Byte2ObjectSortedMap<V>keySet in class AbstractByte2ObjectMap<V>public ObjectSet<Byte2ObjectMap.Entry<V>> byte2ObjectEntrySet()
Byte2ObjectMapbyte2ObjectEntrySet in interface Byte2ObjectMap<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 ByteNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Byte,V>navigableKeySet in interface Byte2ObjectNavigableMap<V>public Byte2ObjectNavigableMap<V> descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Byte,V>descendingMap in interface Byte2ObjectNavigableMap<V>public ByteNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Byte,V>descendingKeySet in interface Byte2ObjectNavigableMap<V>public Byte2ObjectNavigableMap<V> subMap(byte fromKey, boolean fromInclusive, byte toKey, boolean toInclusive)
Byte2ObjectNavigableMapsubMap in interface Byte2ObjectNavigableMap<V>fromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Byte2ObjectNavigableMap<V> headMap(byte toKey, boolean inclusive)
Byte2ObjectNavigableMapheadMap in interface Byte2ObjectNavigableMap<V>toKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Byte2ObjectNavigableMap<V> tailMap(byte fromKey, boolean inclusive)
Byte2ObjectNavigableMaptailMap in interface Byte2ObjectNavigableMap<V>fromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic byte lowerKey(byte e)
Byte2ObjectNavigableMaplowerKey in interface Byte2ObjectNavigableMap<V>e - that should be compared with.public byte floorKey(byte e)
Byte2ObjectNavigableMapfloorKey in interface Byte2ObjectNavigableMap<V>e - that should be compared with.public byte higherKey(byte e)
Byte2ObjectNavigableMaphigherKey in interface Byte2ObjectNavigableMap<V>e - that should be compared with.public byte ceilingKey(byte e)
Byte2ObjectNavigableMapceilingKey in interface Byte2ObjectNavigableMap<V>e - that should be compared with.public Byte2ObjectMap.Entry<V> lowerEntry(byte key)
Byte2ObjectNavigableMaplowerEntry in interface Byte2ObjectNavigableMap<V>key - that should be compared with.public Byte2ObjectMap.Entry<V> higherEntry(byte key)
Byte2ObjectNavigableMaphigherEntry in interface Byte2ObjectNavigableMap<V>key - that should be compared with.public Byte2ObjectMap.Entry<V> floorEntry(byte key)
Byte2ObjectNavigableMapfloorEntry in interface Byte2ObjectNavigableMap<V>key - that should be compared with.public Byte2ObjectMap.Entry<V> ceilingEntry(byte key)
Byte2ObjectNavigableMapceilingEntry in interface Byte2ObjectNavigableMap<V>key - that should be compared with.