public class Short2IntRBTreeMap extends AbstractShort2IntMap implements Short2IntNavigableMap
AbstractShort2IntMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Short2IntSortedMap.FastSortedSetShort2IntMap.BuilderCache, Short2IntMap.Entry, Short2IntMap.FastEntrySet, Short2IntMap.MapBuilder| Constructor and Description |
|---|
Short2IntRBTreeMap()
Default Constructor
|
Short2IntRBTreeMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Integer> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Short2IntRBTreeMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Integer> map,
ShortComparator comp)
A Helper constructor that has a custom sorter and allows to create a Map with exactly the same values as the provided map.
|
Short2IntRBTreeMap(short[] keys,
int[] values)
Helper constructor that allow to create a map from unboxed values
|
Short2IntRBTreeMap(short[] keys,
int[] values,
ShortComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Short2IntRBTreeMap(java.lang.Short[] keys,
java.lang.Integer[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Short2IntRBTreeMap(java.lang.Short[] keys,
java.lang.Integer[] values,
ShortComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Short2IntRBTreeMap(Short2IntMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Short2IntRBTreeMap(Short2IntMap map,
ShortComparator 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.
|
Short2IntRBTreeMap(ShortComparator comp)
Constructor that allows to define the sorter
|
| Modifier and Type | Method and Description |
|---|---|
int |
addTo(short key,
int value)
A Helper method to add a primitives together.
|
Short2IntMap.Entry |
ceilingEntry(short key)
A Type Specific ceilingEntry method to reduce boxing/unboxing.
|
short |
ceilingKey(short e)
A Type Specific ceilingKey method to reduce boxing/unboxing.
|
void |
clear() |
ShortComparator |
comparator() |
int |
computeInt(short key,
ShortIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfAbsent(short key,
Short2IntFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfPresent(short key,
ShortIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(short key)
Type Specific method to reduce boxing/unboxing of values
|
Short2IntRBTreeMap |
copy()
A Function that does a shallow clone of the Map itself.
|
ShortNavigableSet |
descendingKeySet() |
Short2IntNavigableMap |
descendingMap() |
Short2IntMap.Entry |
firstEntry() |
int |
firstIntValue()
A method to get the first Value of a Map.
|
short |
firstShortKey()
A method to get the first Key of a Map.
|
Short2IntMap.Entry |
floorEntry(short key)
A Type Specific floorEntry method to reduce boxing/unboxing.
|
short |
floorKey(short e)
A Type Specific floorKey method to reduce boxing/unboxing.
|
void |
forEach(ShortIntConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
int |
get(short key)
A Type Specific get method to reduce boxing/unboxing
|
short |
getDefaultMaxValue()
A Helper method to get the max value for SubMaps.
|
short |
getDefaultMinValue()
A Helper method to get the min value for SubMaps.
|
int |
getOrDefault(short key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Short2IntNavigableMap |
headMap(short toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Short2IntMap.Entry |
higherEntry(short key)
A Type Specific higherEntry method to reduce boxing/unboxing.
|
short |
higherKey(short e)
A Type Specific higherKey method to reduce boxing/unboxing.
|
ShortNavigableSet |
keySet() |
Short2IntMap.Entry |
lastEntry() |
int |
lastIntValue()
A method to get the last Value of a Map.
|
short |
lastShortKey()
A method to get the last Key of a Map.
|
Short2IntMap.Entry |
lowerEntry(short key)
A Type Specific lowerEntry method to reduce boxing/unboxing.
|
short |
lowerKey(short e)
A Type Specific lowerKey method to reduce boxing/unboxing.
|
void |
mergeAllInt(Short2IntMap m,
IntIntUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
int |
mergeInt(short key,
int value,
IntIntUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
ShortNavigableSet |
navigableKeySet() |
Short2IntMap.Entry |
pollFirstEntry() |
short |
pollFirstShortKey()
A method to get and remove the first Key of a Map.
|
Short2IntMap.Entry |
pollLastEntry() |
short |
pollLastShortKey()
A method to get and remove the last Key of a Map.
|
int |
put(short key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
putIfAbsent(short key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
remove(short key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(short key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
int |
removeOrDefault(short key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
int |
replace(short key,
int value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(short key,
int oldValue,
int newValue)
A Type Specific replace method to replace an existing value
|
void |
setDefaultMaxValue(short value)
A Helper method to set the max value for SubMaps.
|
void |
setDefaultMinValue(short value)
A Helper method to set the min value for SubMaps.
|
ObjectSet<Short2IntMap.Entry> |
short2IntEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
int |
size() |
int |
subFrom(short key,
int value)
A Helper method to subtract from primitive from each other.
|
Short2IntNavigableMap |
subMap(short fromKey,
boolean fromInclusive,
short toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
int |
supplyIntIfAbsent(short key,
IntSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Short2IntNavigableMap |
tailMap(short fromKey,
boolean inclusive)
A Type Specific TailMap method to reduce boxing/unboxing
|
IntCollection |
values() |
addToAll, containsValue, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceInts, replaceInts, 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, replaceInts, replaceInts, setDefaultReturnValuepublic Short2IntRBTreeMap()
public Short2IntRBTreeMap(ShortComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Short2IntRBTreeMap(java.lang.Short[] keys,
java.lang.Integer[] 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 Short2IntRBTreeMap(java.lang.Short[] keys,
java.lang.Integer[] values,
ShortComparator 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 Short2IntRBTreeMap(short[] keys,
int[] 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 Short2IntRBTreeMap(short[] keys,
int[] values,
ShortComparator 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 Short2IntRBTreeMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Integer> map)
map - the values that should be present in the mappublic Short2IntRBTreeMap(java.util.Map<? extends java.lang.Short,? extends java.lang.Integer> map,
ShortComparator comp)
map - the values that should be present in the mapcomp - the function that decides how the tree is sorted, can be nullpublic Short2IntRBTreeMap(Short2IntMap map)
map - the values that should be present in the mappublic Short2IntRBTreeMap(Short2IntMap map, ShortComparator 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(short value)
Short2IntNavigableMapsetDefaultMaxValue in interface Short2IntNavigableMapvalue - the new max valuepublic short getDefaultMaxValue()
Short2IntNavigableMapgetDefaultMaxValue in interface Short2IntNavigableMappublic void setDefaultMinValue(short value)
Short2IntNavigableMapsetDefaultMinValue in interface Short2IntNavigableMapvalue - the new min valuepublic short getDefaultMinValue()
Short2IntNavigableMapgetDefaultMinValue in interface Short2IntNavigableMappublic int put(short key,
int value)
Short2IntMapput in interface Short2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public int putIfAbsent(short key,
int value)
Short2IntMapputIfAbsent in interface Short2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public int addTo(short key,
int value)
Short2IntMapaddTo in interface Short2IntMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic int subFrom(short key,
int value)
Short2IntMapShort2IntMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Short2IntMapkey - that should be subtract fromvalue - that should be subtractpublic ShortComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Short,java.lang.Integer>comparator in interface Short2IntSortedMappublic boolean containsKey(short key)
Short2IntMapcontainsKey in interface Short2IntMapcontainsKey in class AbstractShort2IntMapkey - element that is searched forpublic int get(short key)
Short2IntMapget in interface Short2IntFunctionget in interface Short2IntMapkey - the key that is searched forpublic int getOrDefault(short key,
int defaultValue)
Short2IntMapgetOrDefault in interface Short2IntMapgetOrDefault in class AbstractShort2IntMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic short firstShortKey()
Short2IntSortedMapfirstShortKey in interface Short2IntSortedMappublic short pollFirstShortKey()
Short2IntSortedMappollFirstShortKey in interface Short2IntSortedMappublic short lastShortKey()
Short2IntSortedMaplastShortKey in interface Short2IntSortedMappublic short pollLastShortKey()
Short2IntSortedMappollLastShortKey in interface Short2IntSortedMappublic Short2IntMap.Entry firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Short,java.lang.Integer>firstEntry in interface Short2IntNavigableMappublic Short2IntMap.Entry lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Short,java.lang.Integer>lastEntry in interface Short2IntNavigableMappublic Short2IntMap.Entry pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Short,java.lang.Integer>pollFirstEntry in interface Short2IntNavigableMappublic Short2IntMap.Entry pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Short,java.lang.Integer>pollLastEntry in interface Short2IntNavigableMappublic int firstIntValue()
Short2IntSortedMapfirstIntValue in interface Short2IntSortedMappublic int lastIntValue()
Short2IntSortedMaplastIntValue in interface Short2IntSortedMappublic int remove(short key)
Short2IntMapremove in interface Short2IntMapkey - the element that should be removedpublic int removeOrDefault(short key,
int defaultValue)
Short2IntMapremoveOrDefault in interface Short2IntMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(short key,
int value)
Short2IntMapremove in interface Short2IntMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(short key,
int oldValue,
int newValue)
Short2IntMapreplace in interface Short2IntMapreplace in class AbstractShort2IntMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public int replace(short key,
int value)
Short2IntMapreplace in interface Short2IntMapreplace in class AbstractShort2IntMapkey - the element that should be searched forvalue - the value to replace with.public int computeInt(short key,
ShortIntUnaryOperator mappingFunction)
Short2IntMapcomputeInt in interface Short2IntMapcomputeInt in class AbstractShort2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic int computeIntIfAbsent(short key,
Short2IntFunction mappingFunction)
Short2IntMapcomputeIntIfAbsent in interface Short2IntMapcomputeIntIfAbsent in class AbstractShort2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic int supplyIntIfAbsent(short key,
IntSupplier valueProvider)
Short2IntMapsupplyIntIfAbsent in interface Short2IntMapsupplyIntIfAbsent in class AbstractShort2IntMapkey - the key that should be computedvalueProvider - the value if not presentpublic int computeIntIfPresent(short key,
ShortIntUnaryOperator mappingFunction)
Short2IntMapcomputeIntIfPresent in interface Short2IntMapcomputeIntIfPresent in class AbstractShort2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic int mergeInt(short key,
int value,
IntIntUnaryOperator mappingFunction)
Short2IntMapmergeInt in interface Short2IntMapmergeInt in class AbstractShort2IntMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllInt(Short2IntMap m, IntIntUnaryOperator mappingFunction)
Short2IntMapmergeAllInt in interface Short2IntMapmergeAllInt in class AbstractShort2IntMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void forEach(ShortIntConsumer action)
Short2IntMapforEach in interface Short2IntMapforEach in class AbstractShort2IntMapaction - processor of the values that are iterator overpublic int size()
size in interface java.util.Map<java.lang.Short,java.lang.Integer>size in class java.util.AbstractMap<java.lang.Short,java.lang.Integer>public void clear()
clear in interface java.util.Map<java.lang.Short,java.lang.Integer>clear in class java.util.AbstractMap<java.lang.Short,java.lang.Integer>public Short2IntRBTreeMap copy()
Short2IntMapcopy in interface Short2IntMapcopy in interface Short2IntNavigableMapcopy in interface Short2IntSortedMapcopy in class AbstractShort2IntMappublic ShortNavigableSet keySet()
keySet in interface java.util.Map<java.lang.Short,java.lang.Integer>keySet in interface java.util.SortedMap<java.lang.Short,java.lang.Integer>keySet in interface Short2IntMapkeySet in interface Short2IntNavigableMapkeySet in interface Short2IntSortedMapkeySet in class AbstractShort2IntMappublic ObjectSet<Short2IntMap.Entry> short2IntEntrySet()
Short2IntMapshort2IntEntrySet in interface Short2IntMappublic IntCollection values()
values in interface java.util.Map<java.lang.Short,java.lang.Integer>values in interface java.util.SortedMap<java.lang.Short,java.lang.Integer>values in interface Short2IntMapvalues in interface Short2IntSortedMapvalues in class AbstractShort2IntMappublic ShortNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Short,java.lang.Integer>navigableKeySet in interface Short2IntNavigableMappublic Short2IntNavigableMap descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Short,java.lang.Integer>descendingMap in interface Short2IntNavigableMappublic ShortNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Short,java.lang.Integer>descendingKeySet in interface Short2IntNavigableMappublic Short2IntNavigableMap subMap(short fromKey, boolean fromInclusive, short toKey, boolean toInclusive)
Short2IntNavigableMapsubMap in interface Short2IntNavigableMapfromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Short2IntNavigableMap headMap(short toKey, boolean inclusive)
Short2IntNavigableMapheadMap in interface Short2IntNavigableMaptoKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Short2IntNavigableMap tailMap(short fromKey, boolean inclusive)
Short2IntNavigableMaptailMap in interface Short2IntNavigableMapfromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic short lowerKey(short e)
Short2IntNavigableMaplowerKey in interface Short2IntNavigableMape - that should be compared with.public short floorKey(short e)
Short2IntNavigableMapfloorKey in interface Short2IntNavigableMape - that should be compared with.public short higherKey(short e)
Short2IntNavigableMaphigherKey in interface Short2IntNavigableMape - that should be compared with.public short ceilingKey(short e)
Short2IntNavigableMapceilingKey in interface Short2IntNavigableMape - that should be compared with.public Short2IntMap.Entry lowerEntry(short key)
Short2IntNavigableMaplowerEntry in interface Short2IntNavigableMapkey - that should be compared with.public Short2IntMap.Entry higherEntry(short key)
Short2IntNavigableMaphigherEntry in interface Short2IntNavigableMapkey - that should be compared with.public Short2IntMap.Entry floorEntry(short key)
Short2IntNavigableMapfloorEntry in interface Short2IntNavigableMapkey - that should be compared with.public Short2IntMap.Entry ceilingEntry(short key)
Short2IntNavigableMapceilingEntry in interface Short2IntNavigableMapkey - that should be compared with.