public class Int2LongAVLTreeMap extends AbstractInt2LongMap implements Int2LongNavigableMap
AbstractInt2LongMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2LongSortedMap.FastSortedSetInt2LongMap.BuilderCache, Int2LongMap.Entry, Int2LongMap.FastEntrySet, Int2LongMap.MapBuilder| Constructor and Description |
|---|
Int2LongAVLTreeMap()
Default Constructor
|
Int2LongAVLTreeMap(int[] keys,
long[] values)
Helper constructor that allow to create a map from unboxed values
|
Int2LongAVLTreeMap(int[] keys,
long[] values,
IntComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Int2LongAVLTreeMap(Int2LongMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2LongAVLTreeMap(Int2LongMap map,
IntComparator 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.
|
Int2LongAVLTreeMap(IntComparator comp)
Constructor that allows to define the sorter
|
Int2LongAVLTreeMap(java.lang.Integer[] keys,
java.lang.Long[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2LongAVLTreeMap(java.lang.Integer[] keys,
java.lang.Long[] values,
IntComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Int2LongAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Int2LongAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> map,
IntComparator 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 |
|---|---|
long |
addTo(int key,
long value)
A Helper method to add a primitives together.
|
Int2LongMap.Entry |
ceilingEntry(int key)
A Type Specific ceilingEntry method to reduce boxing/unboxing.
|
int |
ceilingKey(int e)
A Type Specific ceilingKey method to reduce boxing/unboxing.
|
void |
clear() |
IntComparator |
comparator() |
long |
computeLong(int key,
IntLongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfAbsent(int key,
Int2LongFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfPresent(int key,
IntLongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(int key)
Type Specific method to reduce boxing/unboxing of values
|
Int2LongAVLTreeMap |
copy()
A Function that does a shallow clone of the Map itself.
|
IntNavigableSet |
descendingKeySet() |
Int2LongNavigableMap |
descendingMap() |
Int2LongMap.Entry |
firstEntry() |
int |
firstIntKey()
A method to get the first Key of a Map.
|
long |
firstLongValue()
A method to get the first Value of a Map.
|
Int2LongMap.Entry |
floorEntry(int key)
A Type Specific floorEntry method to reduce boxing/unboxing.
|
int |
floorKey(int e)
A Type Specific floorKey method to reduce boxing/unboxing.
|
void |
forEach(IntLongConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
long |
get(int key)
A Type Specific get method to reduce boxing/unboxing
|
int |
getDefaultMaxValue()
A Helper method to get the max value for SubMaps.
|
int |
getDefaultMinValue()
A Helper method to get the min value for SubMaps.
|
long |
getOrDefault(int key,
long defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Int2LongNavigableMap |
headMap(int toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Int2LongMap.Entry |
higherEntry(int key)
A Type Specific higherEntry method to reduce boxing/unboxing.
|
int |
higherKey(int e)
A Type Specific higherKey method to reduce boxing/unboxing.
|
ObjectSet<Int2LongMap.Entry> |
int2LongEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntNavigableSet |
keySet() |
Int2LongMap.Entry |
lastEntry() |
int |
lastIntKey()
A method to get the last Key of a Map.
|
long |
lastLongValue()
A method to get the last Value of a Map.
|
Int2LongMap.Entry |
lowerEntry(int key)
A Type Specific lowerEntry method to reduce boxing/unboxing.
|
int |
lowerKey(int e)
A Type Specific lowerKey method to reduce boxing/unboxing.
|
void |
mergeAllLong(Int2LongMap m,
LongLongUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
long |
mergeLong(int key,
long value,
LongLongUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
IntNavigableSet |
navigableKeySet() |
Int2LongMap.Entry |
pollFirstEntry() |
int |
pollFirstIntKey()
A method to get and remove the first Key of a Map.
|
Int2LongMap.Entry |
pollLastEntry() |
int |
pollLastIntKey()
A method to get and remove the last Key of a Map.
|
long |
put(int key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
putIfAbsent(int key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int key,
long value)
Type Specific remove function to reduce boxing/unboxing
|
long |
removeOrDefault(int key,
long defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
long |
replace(int key,
long value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
long oldValue,
long newValue)
A Type Specific replace method to replace an existing value
|
void |
setDefaultMaxValue(int value)
A Helper method to set the max value for SubMaps.
|
void |
setDefaultMinValue(int value)
A Helper method to set the min value for SubMaps.
|
int |
size() |
long |
subFrom(int key,
long value)
A Helper method to subtract from primitive from each other.
|
Int2LongNavigableMap |
subMap(int fromKey,
boolean fromInclusive,
int toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
long |
supplyLongIfAbsent(int key,
LongSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Int2LongNavigableMap |
tailMap(int fromKey,
boolean inclusive)
A Type Specific TailMap method to reduce boxing/unboxing
|
LongCollection |
values() |
addToAll, containsValue, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceLongs, replaceLongs, setDefaultReturnValueceilingEntry, ceilingKey, floorEntry, floorKey, headMap, headMap, headMap, higherEntry, higherKey, lowerEntry, lowerKey, subMap, subMap, subMap, synchronize, synchronize, tailMap, tailMap, tailMap, unmodifiablefirstKey, lastKeyaddToAll, applyAsLong, builder, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, containsValue, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, remove, remove, replace, replace, replaceAll, replaceLongs, replaceLongs, setDefaultReturnValuepublic Int2LongAVLTreeMap()
public Int2LongAVLTreeMap(IntComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Int2LongAVLTreeMap(java.lang.Integer[] keys,
java.lang.Long[] 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 Int2LongAVLTreeMap(java.lang.Integer[] keys,
java.lang.Long[] values,
IntComparator 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 Int2LongAVLTreeMap(int[] keys,
long[] 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 Int2LongAVLTreeMap(int[] keys,
long[] values,
IntComparator 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 Int2LongAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> map)
map - the values that should be present in the mappublic Int2LongAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> map,
IntComparator comp)
map - the values that should be present in the mapcomp - the function that decides how the tree is sorted, can be nullpublic Int2LongAVLTreeMap(Int2LongMap map)
map - the values that should be present in the mappublic Int2LongAVLTreeMap(Int2LongMap map, IntComparator 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(int value)
Int2LongNavigableMapsetDefaultMaxValue in interface Int2LongNavigableMapvalue - the new max valuepublic int getDefaultMaxValue()
Int2LongNavigableMapgetDefaultMaxValue in interface Int2LongNavigableMappublic void setDefaultMinValue(int value)
Int2LongNavigableMapsetDefaultMinValue in interface Int2LongNavigableMapvalue - the new min valuepublic int getDefaultMinValue()
Int2LongNavigableMapgetDefaultMinValue in interface Int2LongNavigableMappublic long put(int key,
long value)
Int2LongMapput in interface Int2LongMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public long putIfAbsent(int key,
long value)
Int2LongMapputIfAbsent in interface Int2LongMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public long addTo(int key,
long value)
Int2LongMapaddTo in interface Int2LongMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic long subFrom(int key,
long value)
Int2LongMapInt2LongMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Int2LongMapkey - that should be subtract fromvalue - that should be subtractpublic IntComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Integer,java.lang.Long>comparator in interface Int2LongSortedMappublic boolean containsKey(int key)
Int2LongMapcontainsKey in interface Int2LongMapcontainsKey in class AbstractInt2LongMapkey - element that is searched forpublic long get(int key)
Int2LongMapget in interface Int2LongMapkey - the key that is searched forpublic long getOrDefault(int key,
long defaultValue)
Int2LongMapgetOrDefault in interface Int2LongMapgetOrDefault in class AbstractInt2LongMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic int firstIntKey()
Int2LongSortedMapfirstIntKey in interface Int2LongSortedMappublic int pollFirstIntKey()
Int2LongSortedMappollFirstIntKey in interface Int2LongSortedMappublic int lastIntKey()
Int2LongSortedMaplastIntKey in interface Int2LongSortedMappublic int pollLastIntKey()
Int2LongSortedMappollLastIntKey in interface Int2LongSortedMappublic Int2LongMap.Entry firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Integer,java.lang.Long>firstEntry in interface Int2LongNavigableMappublic Int2LongMap.Entry lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Integer,java.lang.Long>lastEntry in interface Int2LongNavigableMappublic Int2LongMap.Entry pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Integer,java.lang.Long>pollFirstEntry in interface Int2LongNavigableMappublic Int2LongMap.Entry pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Integer,java.lang.Long>pollLastEntry in interface Int2LongNavigableMappublic long firstLongValue()
Int2LongSortedMapfirstLongValue in interface Int2LongSortedMappublic long lastLongValue()
Int2LongSortedMaplastLongValue in interface Int2LongSortedMappublic long remove(int key)
Int2LongMapremove in interface Int2LongMapkey - the element that should be removedpublic long removeOrDefault(int key,
long defaultValue)
Int2LongMapremoveOrDefault in interface Int2LongMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(int key,
long value)
Int2LongMapremove in interface Int2LongMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(int key,
long oldValue,
long newValue)
Int2LongMapreplace in interface Int2LongMapreplace in class AbstractInt2LongMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public long replace(int key,
long value)
Int2LongMapreplace in interface Int2LongMapreplace in class AbstractInt2LongMapkey - the element that should be searched forvalue - the value to replace with.public long computeLong(int key,
IntLongUnaryOperator mappingFunction)
Int2LongMapcomputeLong in interface Int2LongMapcomputeLong in class AbstractInt2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic long computeLongIfAbsent(int key,
Int2LongFunction mappingFunction)
Int2LongMapcomputeLongIfAbsent in interface Int2LongMapcomputeLongIfAbsent in class AbstractInt2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic long supplyLongIfAbsent(int key,
LongSupplier valueProvider)
Int2LongMapsupplyLongIfAbsent in interface Int2LongMapsupplyLongIfAbsent in class AbstractInt2LongMapkey - the key that should be computedvalueProvider - the value if not presentpublic long computeLongIfPresent(int key,
IntLongUnaryOperator mappingFunction)
Int2LongMapcomputeLongIfPresent in interface Int2LongMapcomputeLongIfPresent in class AbstractInt2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic long mergeLong(int key,
long value,
LongLongUnaryOperator mappingFunction)
Int2LongMapmergeLong in interface Int2LongMapmergeLong in class AbstractInt2LongMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllLong(Int2LongMap m, LongLongUnaryOperator mappingFunction)
Int2LongMapmergeAllLong in interface Int2LongMapmergeAllLong in class AbstractInt2LongMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void forEach(IntLongConsumer action)
Int2LongMapforEach in interface Int2LongMapforEach in class AbstractInt2LongMapaction - processor of the values that are iterator overpublic int size()
size in interface java.util.Map<java.lang.Integer,java.lang.Long>size in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public void clear()
clear in interface java.util.Map<java.lang.Integer,java.lang.Long>clear in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public Int2LongAVLTreeMap copy()
Int2LongMapcopy in interface Int2LongMapcopy in interface Int2LongNavigableMapcopy in interface Int2LongSortedMapcopy in class AbstractInt2LongMappublic IntNavigableSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Long>keySet in interface java.util.SortedMap<java.lang.Integer,java.lang.Long>keySet in interface Int2LongMapkeySet in interface Int2LongNavigableMapkeySet in interface Int2LongSortedMapkeySet in class AbstractInt2LongMappublic ObjectSet<Int2LongMap.Entry> int2LongEntrySet()
Int2LongMapint2LongEntrySet in interface Int2LongMappublic LongCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Long>values in interface java.util.SortedMap<java.lang.Integer,java.lang.Long>values in interface Int2LongMapvalues in interface Int2LongSortedMapvalues in class AbstractInt2LongMappublic IntNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Integer,java.lang.Long>navigableKeySet in interface Int2LongNavigableMappublic Int2LongNavigableMap descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Integer,java.lang.Long>descendingMap in interface Int2LongNavigableMappublic IntNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Integer,java.lang.Long>descendingKeySet in interface Int2LongNavigableMappublic Int2LongNavigableMap subMap(int fromKey, boolean fromInclusive, int toKey, boolean toInclusive)
Int2LongNavigableMapsubMap in interface Int2LongNavigableMapfromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Int2LongNavigableMap headMap(int toKey, boolean inclusive)
Int2LongNavigableMapheadMap in interface Int2LongNavigableMaptoKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Int2LongNavigableMap tailMap(int fromKey, boolean inclusive)
Int2LongNavigableMaptailMap in interface Int2LongNavigableMapfromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic int lowerKey(int e)
Int2LongNavigableMaplowerKey in interface Int2LongNavigableMape - that should be compared with.public int floorKey(int e)
Int2LongNavigableMapfloorKey in interface Int2LongNavigableMape - that should be compared with.public int higherKey(int e)
Int2LongNavigableMaphigherKey in interface Int2LongNavigableMape - that should be compared with.public int ceilingKey(int e)
Int2LongNavigableMapceilingKey in interface Int2LongNavigableMape - that should be compared with.public Int2LongMap.Entry lowerEntry(int key)
Int2LongNavigableMaplowerEntry in interface Int2LongNavigableMapkey - that should be compared with.public Int2LongMap.Entry higherEntry(int key)
Int2LongNavigableMaphigherEntry in interface Int2LongNavigableMapkey - that should be compared with.public Int2LongMap.Entry floorEntry(int key)
Int2LongNavigableMapfloorEntry in interface Int2LongNavigableMapkey - that should be compared with.public Int2LongMap.Entry ceilingEntry(int key)
Int2LongNavigableMapceilingEntry in interface Int2LongNavigableMapkey - that should be compared with.