public class Long2ShortRBTreeMap extends AbstractLong2ShortMap implements Long2ShortNavigableMap
AbstractLong2ShortMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ShortSortedMap.FastSortedSetLong2ShortMap.FastEntrySet| Constructor and Description |
|---|
Long2ShortRBTreeMap()
Default Constructor
|
Long2ShortRBTreeMap(long[] keys,
short[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2ShortRBTreeMap(java.lang.Long[] keys,
java.lang.Short[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2ShortRBTreeMap(long[] keys,
short[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Long2ShortRBTreeMap(java.lang.Long[] keys,
java.lang.Short[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Long2ShortRBTreeMap(Long2ShortMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2ShortRBTreeMap(Long2ShortMap map,
LongComparator 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.
|
Long2ShortRBTreeMap(LongComparator comp)
Constructor that allows to define the sorter
|
Long2ShortRBTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Short> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Long2ShortRBTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Short> map,
LongComparator 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(long key,
short value)
A Helper method to add a primitives together.
|
Long2ShortMap.Entry |
ceilingEntry(long key)
A Type Specific ceilingEntry method to reduce boxing/unboxing.
|
long |
ceilingKey(long e)
A Type Specific ceilingKey method to reduce boxing/unboxing.
|
void |
clear() |
LongComparator |
comparator() |
short |
computeShort(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long key)
Type Specific method to reduce boxing/unboxing of values
|
LongNavigableSet |
descendingKeySet() |
Long2ShortNavigableMap |
descendingMap() |
Long2ShortMap.Entry |
firstEntry() |
long |
firstLongKey()
A method to get the first Key of a Map.
|
short |
firstShortValue()
A method to get the first Value of a Map.
|
Long2ShortMap.Entry |
floorEntry(long key)
A Type Specific floorEntry method to reduce boxing/unboxing.
|
long |
floorKey(long e)
A Type Specific floorKey method to reduce boxing/unboxing.
|
short |
getAndMoveToFirst(long key)
A Specific get method that allows to move teh given key/value int the first index.
|
short |
getAndMoveToLast(long key)
A Specific get method that allows to move teh given key/value int the last index.
|
long |
getDefaultMaxValue()
A Helper method to get the max value for SubMaps.
|
long |
getDefaultMinValue()
A Helper method to get the min value for SubMaps.
|
short |
getOrDefault(long key,
short defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
short |
getShort(long key)
A Type Specific get method to reduce boxing/unboxing
|
Long2ShortNavigableMap |
headMap(long toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Long2ShortMap.Entry |
higherEntry(long key)
A Type Specific higherEntry method to reduce boxing/unboxing.
|
long |
higherKey(long e)
A Type Specific higherKey method to reduce boxing/unboxing.
|
LongSortedSet |
keySet() |
Long2ShortMap.Entry |
lastEntry() |
long |
lastLongKey()
A method to get the last Key of a Map.
|
short |
lastShortValue()
A method to get the last Value of a Map.
|
ObjectSet<Long2ShortMap.Entry> |
long2ShortEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Long2ShortMap.Entry |
lowerEntry(long key)
A Type Specific lowerEntry method to reduce boxing/unboxing.
|
long |
lowerKey(long e)
A Type Specific lowerKey method to reduce boxing/unboxing.
|
void |
mergeAllShort(Long2ShortMap m,
ShortShortUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
short |
mergeShort(long key,
short value,
ShortShortUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(long key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(long key)
A specific move method to move a given key/value to the last index.
|
LongNavigableSet |
navigableKeySet() |
Long2ShortMap.Entry |
pollFirstEntry() |
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
Long2ShortMap.Entry |
pollLastEntry() |
long |
pollLastLongKey()
A method to get and remove the last Key of a Map.
|
short |
put(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
putAndMoveToFirst(long key,
short value)
A customized put method that allows you to insert into the first index.
|
short |
putAndMoveToLast(long key,
short value)
A customized put method that allows you to insert into the last index.
|
short |
putIfAbsent(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
remLong(long key)
Type Specific remove function to reduce boxing/unboxing
|
short |
remLongOrDefault(long key,
short defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(long key,
short value)
Type Specific remove function to reduce boxing/unboxing
|
short |
replace(long key,
short value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
short oldValue,
short newValue)
A Type Specific replace method to replace an existing value
|
void |
setDefaultMaxValue(long value)
A Helper method to set the max value for SubMaps.
|
void |
setDefaultMinValue(long value)
A Helper method to set the min value for SubMaps.
|
int |
size() |
Long2ShortNavigableMap |
subMap(long fromKey,
boolean fromInclusive,
long toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
Long2ShortNavigableMap |
tailMap(long fromKey,
boolean inclusive)
A Type Specific TailMap method to reduce boxing/unboxing
|
ShortCollection |
values() |
addToAll, containsValue, entrySet, equals, forEach, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceShorts, replaceShorts, setDefaultReturnValuecontainsKey, containsValue, isEmpty, put, remove, toStringceilingEntry, ceilingKey, floorEntry, floorKey, headMap, headMap, headMap, higherEntry, higherKey, lowerEntry, lowerKey, subMap, subMap, subMap, tailMap, tailMap, tailMapfirstKey, lastKeyaddToAll, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, containsValue, entrySet, forEach, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, remove, remove, replace, replace, replaceAll, replaceShorts, replaceShorts, setDefaultReturnValuepublic Long2ShortRBTreeMap()
public Long2ShortRBTreeMap(LongComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Long2ShortRBTreeMap(java.lang.Long[] 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 Long2ShortRBTreeMap(java.lang.Long[] keys,
java.lang.Short[] values,
LongComparator 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 Long2ShortRBTreeMap(long[] 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 Long2ShortRBTreeMap(long[] keys,
short[] values,
LongComparator 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 Long2ShortRBTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Short> map)
map - the values that should be present in the mappublic Long2ShortRBTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Short> map,
LongComparator comp)
map - the values that should be present in the mapcomp - the function that decides how the tree is sorted, can be nullpublic Long2ShortRBTreeMap(Long2ShortMap map)
map - the values that should be present in the mappublic Long2ShortRBTreeMap(Long2ShortMap map, LongComparator 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(long value)
Long2ShortNavigableMapsetDefaultMaxValue in interface Long2ShortNavigableMapvalue - the new max valuepublic long getDefaultMaxValue()
Long2ShortNavigableMapgetDefaultMaxValue in interface Long2ShortNavigableMappublic void setDefaultMinValue(long value)
Long2ShortNavigableMapsetDefaultMinValue in interface Long2ShortNavigableMapvalue - the new min valuepublic long getDefaultMinValue()
Long2ShortNavigableMapgetDefaultMinValue in interface Long2ShortNavigableMappublic short put(long key,
short value)
Long2ShortMapput in interface Long2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public short putIfAbsent(long key,
short value)
Long2ShortMapputIfAbsent in interface Long2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public short addTo(long key,
short value)
Long2ShortMapaddTo in interface Long2ShortMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic short putAndMoveToFirst(long key,
short value)
Long2ShortSortedMapputAndMoveToFirst in interface Long2ShortSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public short putAndMoveToLast(long key,
short value)
Long2ShortSortedMapputAndMoveToLast in interface Long2ShortSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(long key)
Long2ShortSortedMapmoveToFirst in interface Long2ShortSortedMapkey - that should be moved to the first indexpublic boolean moveToLast(long key)
Long2ShortSortedMapmoveToLast in interface Long2ShortSortedMapkey - that should be moved to the first lastpublic short getAndMoveToFirst(long key)
Long2ShortSortedMapgetAndMoveToFirst in interface Long2ShortSortedMapkey - that is searched forpublic short getAndMoveToLast(long key)
Long2ShortSortedMapgetAndMoveToLast in interface Long2ShortSortedMapkey - that is searched forpublic LongComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Long,java.lang.Short>comparator in interface Long2ShortSortedMappublic boolean containsKey(long key)
Long2ShortMapcontainsKey in interface Long2ShortMapcontainsKey in class AbstractLong2ShortMapkey - element that is searched forpublic short getShort(long key)
Long2ShortMapgetShort in interface Long2ShortFunctiongetShort in interface Long2ShortMapkey - the key that is searched forpublic short getOrDefault(long key,
short defaultValue)
Long2ShortMapgetOrDefault in interface Long2ShortMapgetOrDefault in class AbstractLong2ShortMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic long firstLongKey()
Long2ShortSortedMapfirstLongKey in interface Long2ShortSortedMappublic long pollFirstLongKey()
Long2ShortSortedMappollFirstLongKey in interface Long2ShortSortedMappublic long lastLongKey()
Long2ShortSortedMaplastLongKey in interface Long2ShortSortedMappublic long pollLastLongKey()
Long2ShortSortedMappollLastLongKey in interface Long2ShortSortedMappublic Long2ShortMap.Entry firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Short>firstEntry in interface Long2ShortNavigableMappublic Long2ShortMap.Entry lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Short>lastEntry in interface Long2ShortNavigableMappublic Long2ShortMap.Entry pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Short>pollFirstEntry in interface Long2ShortNavigableMappublic Long2ShortMap.Entry pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Short>pollLastEntry in interface Long2ShortNavigableMappublic short firstShortValue()
Long2ShortSortedMapfirstShortValue in interface Long2ShortSortedMappublic short lastShortValue()
Long2ShortSortedMaplastShortValue in interface Long2ShortSortedMappublic short remLong(long key)
Long2ShortMapremLong in interface Long2ShortMapkey - the element that should be removedpublic short remLongOrDefault(long key,
short defaultValue)
Long2ShortMapremLongOrDefault in interface Long2ShortMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(long key,
short value)
Long2ShortMapremove in interface Long2ShortMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(long key,
short oldValue,
short newValue)
Long2ShortMapreplace in interface Long2ShortMapreplace in class AbstractLong2ShortMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public short replace(long key,
short value)
Long2ShortMapreplace in interface Long2ShortMapreplace in class AbstractLong2ShortMapkey - the element that should be searched forvalue - the value to replace with.public short computeShort(long key,
LongShortUnaryOperator mappingFunction)
Long2ShortMapcomputeShort in interface Long2ShortMapcomputeShort in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic short computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
Long2ShortMapcomputeShortIfAbsent in interface Long2ShortMapcomputeShortIfAbsent in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic short computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
Long2ShortMapcomputeShortIfPresent in interface Long2ShortMapcomputeShortIfPresent in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic short mergeShort(long key,
short value,
ShortShortUnaryOperator mappingFunction)
Long2ShortMapmergeShort in interface Long2ShortMapmergeShort in class AbstractLong2ShortMapkey - 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(Long2ShortMap m, ShortShortUnaryOperator mappingFunction)
Long2ShortMapmergeAllShort in interface Long2ShortMapmergeAllShort in class AbstractLong2ShortMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
size in interface java.util.Map<java.lang.Long,java.lang.Short>size in class java.util.AbstractMap<java.lang.Long,java.lang.Short>public void clear()
clear in interface java.util.Map<java.lang.Long,java.lang.Short>clear in class java.util.AbstractMap<java.lang.Long,java.lang.Short>public LongSortedSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Short>keySet in interface java.util.SortedMap<java.lang.Long,java.lang.Short>keySet in interface Long2ShortMapkeySet in interface Long2ShortSortedMapkeySet in class AbstractLong2ShortMappublic ObjectSet<Long2ShortMap.Entry> long2ShortEntrySet()
Long2ShortMaplong2ShortEntrySet in interface Long2ShortMappublic ShortCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Short>values in interface java.util.SortedMap<java.lang.Long,java.lang.Short>values in interface Long2ShortMapvalues in interface Long2ShortSortedMapvalues in class AbstractLong2ShortMappublic LongNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Long,java.lang.Short>navigableKeySet in interface Long2ShortNavigableMappublic Long2ShortNavigableMap descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Long,java.lang.Short>descendingMap in interface Long2ShortNavigableMappublic LongNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Long,java.lang.Short>descendingKeySet in interface Long2ShortNavigableMappublic Long2ShortNavigableMap subMap(long fromKey, boolean fromInclusive, long toKey, boolean toInclusive)
Long2ShortNavigableMapsubMap in interface Long2ShortNavigableMapfromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Long2ShortNavigableMap headMap(long toKey, boolean inclusive)
Long2ShortNavigableMapheadMap in interface Long2ShortNavigableMaptoKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Long2ShortNavigableMap tailMap(long fromKey, boolean inclusive)
Long2ShortNavigableMaptailMap in interface Long2ShortNavigableMapfromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic long lowerKey(long e)
Long2ShortNavigableMaplowerKey in interface Long2ShortNavigableMape - that should be compared with.public long floorKey(long e)
Long2ShortNavigableMapfloorKey in interface Long2ShortNavigableMape - that should be compared with.public long higherKey(long e)
Long2ShortNavigableMaphigherKey in interface Long2ShortNavigableMape - that should be compared with.public long ceilingKey(long e)
Long2ShortNavigableMapceilingKey in interface Long2ShortNavigableMape - that should be compared with.public Long2ShortMap.Entry lowerEntry(long key)
Long2ShortNavigableMaplowerEntry in interface Long2ShortNavigableMapkey - that should be compared with.public Long2ShortMap.Entry higherEntry(long key)
Long2ShortNavigableMaphigherEntry in interface Long2ShortNavigableMapkey - that should be compared with.public Long2ShortMap.Entry floorEntry(long key)
Long2ShortNavigableMapfloorEntry in interface Long2ShortNavigableMapkey - that should be compared with.public Long2ShortMap.Entry ceilingEntry(long key)
Long2ShortNavigableMapceilingEntry in interface Long2ShortNavigableMapkey - that should be compared with.