public class Byte2ShortAVLTreeMap extends AbstractByte2ShortMap implements Byte2ShortNavigableMap
AbstractByte2ShortMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Byte2ShortSortedMap.FastSortedSetByte2ShortMap.BuilderCache, Byte2ShortMap.Entry, Byte2ShortMap.FastEntrySet, Byte2ShortMap.MapBuilder| Constructor and Description |
|---|
Byte2ShortAVLTreeMap()
Default Constructor
|
Byte2ShortAVLTreeMap(byte[] keys,
short[] values)
Helper constructor that allow to create a map from unboxed values
|
Byte2ShortAVLTreeMap(java.lang.Byte[] keys,
java.lang.Short[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Byte2ShortAVLTreeMap(byte[] keys,
short[] values,
ByteComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Byte2ShortAVLTreeMap(java.lang.Byte[] keys,
java.lang.Short[] values,
ByteComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Byte2ShortAVLTreeMap(Byte2ShortMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Byte2ShortAVLTreeMap(Byte2ShortMap 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.
|
Byte2ShortAVLTreeMap(ByteComparator comp)
Constructor that allows to define the sorter
|
Byte2ShortAVLTreeMap(java.util.Map<? extends java.lang.Byte,? extends java.lang.Short> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Byte2ShortAVLTreeMap(java.util.Map<? extends java.lang.Byte,? extends java.lang.Short> 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 |
|---|---|
short |
addTo(byte key,
short value)
A Helper method to add a primitives together.
|
ObjectSet<Byte2ShortMap.Entry> |
byte2ShortEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Byte2ShortMap.Entry |
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() |
short |
computeShort(byte key,
ByteShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfAbsent(byte key,
Byte2ShortFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfPresent(byte key,
ByteShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(byte key)
Type Specific method to reduce boxing/unboxing of values
|
Byte2ShortAVLTreeMap |
copy()
A Function that does a shallow clone of the Map itself.
|
ByteNavigableSet |
descendingKeySet() |
Byte2ShortNavigableMap |
descendingMap() |
byte |
firstByteKey()
A method to get the first Key of a Map.
|
Byte2ShortMap.Entry |
firstEntry() |
short |
firstShortValue()
A method to get the first Value of a Map.
|
Byte2ShortMap.Entry |
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(ByteShortConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
short |
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.
|
short |
getOrDefault(byte key,
short defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Byte2ShortNavigableMap |
headMap(byte toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Byte2ShortMap.Entry |
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.
|
Byte2ShortMap.Entry |
lastEntry() |
short |
lastShortValue()
A method to get the last Value of a Map.
|
Byte2ShortMap.Entry |
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.
|
void |
mergeAllShort(Byte2ShortMap m,
ShortShortUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
short |
mergeShort(byte key,
short value,
ShortShortUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
ByteNavigableSet |
navigableKeySet() |
byte |
pollFirstByteKey()
A method to get and remove the first Key of a Map.
|
Byte2ShortMap.Entry |
pollFirstEntry() |
byte |
pollLastByteKey()
A method to get and remove the last Key of a Map.
|
Byte2ShortMap.Entry |
pollLastEntry() |
short |
put(byte key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
putIfAbsent(byte key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
remove(byte key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(byte key,
short value)
Type Specific remove function to reduce boxing/unboxing
|
short |
removeOrDefault(byte key,
short defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
short |
replace(byte key,
short value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(byte key,
short oldValue,
short 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() |
short |
subFrom(byte key,
short value)
A Helper method to subtract from primitive from each other.
|
Byte2ShortNavigableMap |
subMap(byte fromKey,
boolean fromInclusive,
byte toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
short |
supplyShortIfAbsent(byte key,
ShortSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Byte2ShortNavigableMap |
tailMap(byte fromKey,
boolean inclusive)
A Type Specific TailMap method to reduce boxing/unboxing
|
ShortCollection |
values() |
addToAll, containsValue, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceShorts, replaceShorts, setDefaultReturnValueceilingEntry, ceilingKey, floorEntry, floorKey, headMap, headMap, headMap, higherEntry, higherKey, lowerEntry, lowerKey, subMap, subMap, subMap, synchronize, synchronize, tailMap, tailMap, tailMap, unmodifiablefirstKey, lastKeyaddToAll, builder, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, containsValue, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, remove, remove, replace, replace, replaceAll, replaceShorts, replaceShorts, setDefaultReturnValuepublic Byte2ShortAVLTreeMap()
public Byte2ShortAVLTreeMap(ByteComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Byte2ShortAVLTreeMap(java.lang.Byte[] keys,
java.lang.Short[] 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 Byte2ShortAVLTreeMap(java.lang.Byte[] keys,
java.lang.Short[] 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 Byte2ShortAVLTreeMap(byte[] keys,
short[] 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 Byte2ShortAVLTreeMap(byte[] keys,
short[] 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 Byte2ShortAVLTreeMap(java.util.Map<? extends java.lang.Byte,? extends java.lang.Short> map)
map - the values that should be present in the mappublic Byte2ShortAVLTreeMap(java.util.Map<? extends java.lang.Byte,? extends java.lang.Short> 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 Byte2ShortAVLTreeMap(Byte2ShortMap map)
map - the values that should be present in the mappublic Byte2ShortAVLTreeMap(Byte2ShortMap 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)
Byte2ShortNavigableMapsetDefaultMaxValue in interface Byte2ShortNavigableMapvalue - the new max valuepublic byte getDefaultMaxValue()
Byte2ShortNavigableMapgetDefaultMaxValue in interface Byte2ShortNavigableMappublic void setDefaultMinValue(byte value)
Byte2ShortNavigableMapsetDefaultMinValue in interface Byte2ShortNavigableMapvalue - the new min valuepublic byte getDefaultMinValue()
Byte2ShortNavigableMapgetDefaultMinValue in interface Byte2ShortNavigableMappublic short put(byte key,
short value)
Byte2ShortMapput in interface Byte2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public short putIfAbsent(byte key,
short value)
Byte2ShortMapputIfAbsent in interface Byte2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public short addTo(byte key,
short value)
Byte2ShortMapaddTo in interface Byte2ShortMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic short subFrom(byte key,
short value)
Byte2ShortMapByte2ShortMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Byte2ShortMapkey - that should be subtract fromvalue - that should be subtractpublic ByteComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Byte,java.lang.Short>comparator in interface Byte2ShortSortedMappublic boolean containsKey(byte key)
Byte2ShortMapcontainsKey in interface Byte2ShortMapcontainsKey in class AbstractByte2ShortMapkey - element that is searched forpublic short get(byte key)
Byte2ShortMapget in interface Byte2ShortFunctionget in interface Byte2ShortMapkey - the key that is searched forpublic short getOrDefault(byte key,
short defaultValue)
Byte2ShortMapgetOrDefault in interface Byte2ShortMapgetOrDefault in class AbstractByte2ShortMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic byte firstByteKey()
Byte2ShortSortedMapfirstByteKey in interface Byte2ShortSortedMappublic byte pollFirstByteKey()
Byte2ShortSortedMappollFirstByteKey in interface Byte2ShortSortedMappublic byte lastByteKey()
Byte2ShortSortedMaplastByteKey in interface Byte2ShortSortedMappublic byte pollLastByteKey()
Byte2ShortSortedMappollLastByteKey in interface Byte2ShortSortedMappublic Byte2ShortMap.Entry firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Byte,java.lang.Short>firstEntry in interface Byte2ShortNavigableMappublic Byte2ShortMap.Entry lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Byte,java.lang.Short>lastEntry in interface Byte2ShortNavigableMappublic Byte2ShortMap.Entry pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Byte,java.lang.Short>pollFirstEntry in interface Byte2ShortNavigableMappublic Byte2ShortMap.Entry pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Byte,java.lang.Short>pollLastEntry in interface Byte2ShortNavigableMappublic short firstShortValue()
Byte2ShortSortedMapfirstShortValue in interface Byte2ShortSortedMappublic short lastShortValue()
Byte2ShortSortedMaplastShortValue in interface Byte2ShortSortedMappublic short remove(byte key)
Byte2ShortMapremove in interface Byte2ShortMapkey - the element that should be removedpublic short removeOrDefault(byte key,
short defaultValue)
Byte2ShortMapremoveOrDefault in interface Byte2ShortMapkey - 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,
short value)
Byte2ShortMapremove in interface Byte2ShortMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(byte key,
short oldValue,
short newValue)
Byte2ShortMapreplace in interface Byte2ShortMapreplace in class AbstractByte2ShortMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public short replace(byte key,
short value)
Byte2ShortMapreplace in interface Byte2ShortMapreplace in class AbstractByte2ShortMapkey - the element that should be searched forvalue - the value to replace with.public short computeShort(byte key,
ByteShortUnaryOperator mappingFunction)
Byte2ShortMapcomputeShort in interface Byte2ShortMapcomputeShort in class AbstractByte2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic short computeShortIfAbsent(byte key,
Byte2ShortFunction mappingFunction)
Byte2ShortMapcomputeShortIfAbsent in interface Byte2ShortMapcomputeShortIfAbsent in class AbstractByte2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic short supplyShortIfAbsent(byte key,
ShortSupplier valueProvider)
Byte2ShortMapsupplyShortIfAbsent in interface Byte2ShortMapsupplyShortIfAbsent in class AbstractByte2ShortMapkey - the key that should be computedvalueProvider - the value if not presentpublic short computeShortIfPresent(byte key,
ByteShortUnaryOperator mappingFunction)
Byte2ShortMapcomputeShortIfPresent in interface Byte2ShortMapcomputeShortIfPresent in class AbstractByte2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic short mergeShort(byte key,
short value,
ShortShortUnaryOperator mappingFunction)
Byte2ShortMapmergeShort in interface Byte2ShortMapmergeShort in class AbstractByte2ShortMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllShort(Byte2ShortMap m, ShortShortUnaryOperator mappingFunction)
Byte2ShortMapmergeAllShort in interface Byte2ShortMapmergeAllShort in class AbstractByte2ShortMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void forEach(ByteShortConsumer action)
Byte2ShortMapforEach in interface Byte2ShortMapforEach in class AbstractByte2ShortMapaction - processor of the values that are iterator overpublic int size()
size in interface java.util.Map<java.lang.Byte,java.lang.Short>size in class java.util.AbstractMap<java.lang.Byte,java.lang.Short>public void clear()
clear in interface java.util.Map<java.lang.Byte,java.lang.Short>clear in class java.util.AbstractMap<java.lang.Byte,java.lang.Short>public Byte2ShortAVLTreeMap copy()
Byte2ShortMapcopy in interface Byte2ShortMapcopy in interface Byte2ShortNavigableMapcopy in interface Byte2ShortSortedMapcopy in class AbstractByte2ShortMappublic ByteNavigableSet keySet()
keySet in interface java.util.Map<java.lang.Byte,java.lang.Short>keySet in interface java.util.SortedMap<java.lang.Byte,java.lang.Short>keySet in interface Byte2ShortMapkeySet in interface Byte2ShortNavigableMapkeySet in interface Byte2ShortSortedMapkeySet in class AbstractByte2ShortMappublic ObjectSet<Byte2ShortMap.Entry> byte2ShortEntrySet()
Byte2ShortMapbyte2ShortEntrySet in interface Byte2ShortMappublic ShortCollection values()
values in interface java.util.Map<java.lang.Byte,java.lang.Short>values in interface java.util.SortedMap<java.lang.Byte,java.lang.Short>values in interface Byte2ShortMapvalues in interface Byte2ShortSortedMapvalues in class AbstractByte2ShortMappublic ByteNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Byte,java.lang.Short>navigableKeySet in interface Byte2ShortNavigableMappublic Byte2ShortNavigableMap descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Byte,java.lang.Short>descendingMap in interface Byte2ShortNavigableMappublic ByteNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Byte,java.lang.Short>descendingKeySet in interface Byte2ShortNavigableMappublic Byte2ShortNavigableMap subMap(byte fromKey, boolean fromInclusive, byte toKey, boolean toInclusive)
Byte2ShortNavigableMapsubMap in interface Byte2ShortNavigableMapfromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Byte2ShortNavigableMap headMap(byte toKey, boolean inclusive)
Byte2ShortNavigableMapheadMap in interface Byte2ShortNavigableMaptoKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Byte2ShortNavigableMap tailMap(byte fromKey, boolean inclusive)
Byte2ShortNavigableMaptailMap in interface Byte2ShortNavigableMapfromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic byte lowerKey(byte e)
Byte2ShortNavigableMaplowerKey in interface Byte2ShortNavigableMape - that should be compared with.public byte floorKey(byte e)
Byte2ShortNavigableMapfloorKey in interface Byte2ShortNavigableMape - that should be compared with.public byte higherKey(byte e)
Byte2ShortNavigableMaphigherKey in interface Byte2ShortNavigableMape - that should be compared with.public byte ceilingKey(byte e)
Byte2ShortNavigableMapceilingKey in interface Byte2ShortNavigableMape - that should be compared with.public Byte2ShortMap.Entry lowerEntry(byte key)
Byte2ShortNavigableMaplowerEntry in interface Byte2ShortNavigableMapkey - that should be compared with.public Byte2ShortMap.Entry higherEntry(byte key)
Byte2ShortNavigableMaphigherEntry in interface Byte2ShortNavigableMapkey - that should be compared with.public Byte2ShortMap.Entry floorEntry(byte key)
Byte2ShortNavigableMapfloorEntry in interface Byte2ShortNavigableMapkey - that should be compared with.public Byte2ShortMap.Entry ceilingEntry(byte key)
Byte2ShortNavigableMapceilingEntry in interface Byte2ShortNavigableMapkey - that should be compared with.