public class Long2IntAVLTreeMap extends AbstractLong2IntMap implements Long2IntNavigableMap
AbstractLong2IntMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2IntSortedMap.FastSortedSetLong2IntMap.FastEntrySet| Constructor and Description |
|---|
Long2IntAVLTreeMap()
Default Constructor
|
Long2IntAVLTreeMap(long[] keys,
int[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2IntAVLTreeMap(long[] keys,
int[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Long2IntAVLTreeMap(java.lang.Long[] keys,
java.lang.Integer[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2IntAVLTreeMap(java.lang.Long[] keys,
java.lang.Integer[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Long2IntAVLTreeMap(Long2IntMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2IntAVLTreeMap(Long2IntMap 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.
|
Long2IntAVLTreeMap(LongComparator comp)
Constructor that allows to define the sorter
|
Long2IntAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Integer> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Long2IntAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Integer> 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 |
|---|---|
int |
addTo(long key,
int value)
A Helper method to add a primitives together.
|
Long2IntMap.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() |
int |
computeInt(long key,
LongIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfAbsent(long key,
Long2IntFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfPresent(long key,
LongIntUnaryOperator 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() |
Long2IntNavigableMap |
descendingMap() |
Long2IntMap.Entry |
firstEntry() |
int |
firstIntValue()
A method to get the first Value of a Map.
|
long |
firstLongKey()
A method to get the first Key of a Map.
|
Long2IntMap.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.
|
int |
getAndMoveToFirst(long key)
A Specific get method that allows to move teh given key/value int the first index.
|
int |
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.
|
int |
getInt(long key)
A Type Specific get method to reduce boxing/unboxing
|
int |
getOrDefault(long key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Long2IntNavigableMap |
headMap(long toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Long2IntMap.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() |
Long2IntMap.Entry |
lastEntry() |
int |
lastIntValue()
A method to get the last Value of a Map.
|
long |
lastLongKey()
A method to get the last Key of a Map.
|
ObjectSet<Long2IntMap.Entry> |
long2IntEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Long2IntMap.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 |
mergeAllInt(Long2IntMap m,
IntIntUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
int |
mergeInt(long key,
int value,
IntIntUnaryOperator 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() |
Long2IntMap.Entry |
pollFirstEntry() |
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
Long2IntMap.Entry |
pollLastEntry() |
long |
pollLastLongKey()
A method to get and remove the last Key of a Map.
|
int |
put(long key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
putAndMoveToFirst(long key,
int value)
A customized put method that allows you to insert into the first index.
|
int |
putAndMoveToLast(long key,
int value)
A customized put method that allows you to insert into the last index.
|
int |
putIfAbsent(long key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
remLong(long key)
Type Specific remove function to reduce boxing/unboxing
|
int |
remLongOrDefault(long key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(long key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
int |
replace(long key,
int value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
int oldValue,
int 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() |
Long2IntNavigableMap |
subMap(long fromKey,
boolean fromInclusive,
long toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
Long2IntNavigableMap |
tailMap(long fromKey,
boolean inclusive)
A Type Specific TailMap method to reduce boxing/unboxing
|
IntCollection |
values() |
addToAll, containsValue, entrySet, equals, forEach, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceInts, replaceInts, 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, replaceInts, replaceInts, setDefaultReturnValueapplyAsIntpublic Long2IntAVLTreeMap()
public Long2IntAVLTreeMap(LongComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Long2IntAVLTreeMap(java.lang.Long[] 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 Long2IntAVLTreeMap(java.lang.Long[] keys,
java.lang.Integer[] 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 Long2IntAVLTreeMap(long[] 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 Long2IntAVLTreeMap(long[] keys,
int[] 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 Long2IntAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Integer> map)
map - the values that should be present in the mappublic Long2IntAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Integer> 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 Long2IntAVLTreeMap(Long2IntMap map)
map - the values that should be present in the mappublic Long2IntAVLTreeMap(Long2IntMap 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)
Long2IntNavigableMapsetDefaultMaxValue in interface Long2IntNavigableMapvalue - the new max valuepublic long getDefaultMaxValue()
Long2IntNavigableMapgetDefaultMaxValue in interface Long2IntNavigableMappublic void setDefaultMinValue(long value)
Long2IntNavigableMapsetDefaultMinValue in interface Long2IntNavigableMapvalue - the new min valuepublic long getDefaultMinValue()
Long2IntNavigableMapgetDefaultMinValue in interface Long2IntNavigableMappublic int put(long key,
int value)
Long2IntMapput in interface Long2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public int putIfAbsent(long key,
int value)
Long2IntMapputIfAbsent in interface Long2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public int addTo(long key,
int value)
Long2IntMapaddTo in interface Long2IntMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic int putAndMoveToFirst(long key,
int value)
Long2IntSortedMapputAndMoveToFirst in interface Long2IntSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public int putAndMoveToLast(long key,
int value)
Long2IntSortedMapputAndMoveToLast in interface Long2IntSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(long key)
Long2IntSortedMapmoveToFirst in interface Long2IntSortedMapkey - that should be moved to the first indexpublic boolean moveToLast(long key)
Long2IntSortedMapmoveToLast in interface Long2IntSortedMapkey - that should be moved to the first lastpublic int getAndMoveToFirst(long key)
Long2IntSortedMapgetAndMoveToFirst in interface Long2IntSortedMapkey - that is searched forpublic int getAndMoveToLast(long key)
Long2IntSortedMapgetAndMoveToLast in interface Long2IntSortedMapkey - that is searched forpublic LongComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Long,java.lang.Integer>comparator in interface Long2IntSortedMappublic boolean containsKey(long key)
Long2IntMapcontainsKey in interface Long2IntMapcontainsKey in class AbstractLong2IntMapkey - element that is searched forpublic int getInt(long key)
Long2IntMapgetInt in interface Long2IntFunctiongetInt in interface Long2IntMapkey - the key that is searched forpublic int getOrDefault(long key,
int defaultValue)
Long2IntMapgetOrDefault in interface Long2IntMapgetOrDefault in class AbstractLong2IntMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic long firstLongKey()
Long2IntSortedMapfirstLongKey in interface Long2IntSortedMappublic long pollFirstLongKey()
Long2IntSortedMappollFirstLongKey in interface Long2IntSortedMappublic long lastLongKey()
Long2IntSortedMaplastLongKey in interface Long2IntSortedMappublic long pollLastLongKey()
Long2IntSortedMappollLastLongKey in interface Long2IntSortedMappublic Long2IntMap.Entry firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Integer>firstEntry in interface Long2IntNavigableMappublic Long2IntMap.Entry lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Integer>lastEntry in interface Long2IntNavigableMappublic Long2IntMap.Entry pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Integer>pollFirstEntry in interface Long2IntNavigableMappublic Long2IntMap.Entry pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Integer>pollLastEntry in interface Long2IntNavigableMappublic int firstIntValue()
Long2IntSortedMapfirstIntValue in interface Long2IntSortedMappublic int lastIntValue()
Long2IntSortedMaplastIntValue in interface Long2IntSortedMappublic int remLong(long key)
Long2IntMapremLong in interface Long2IntMapkey - the element that should be removedpublic int remLongOrDefault(long key,
int defaultValue)
Long2IntMapremLongOrDefault in interface Long2IntMapkey - 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,
int value)
Long2IntMapremove in interface Long2IntMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(long key,
int oldValue,
int newValue)
Long2IntMapreplace in interface Long2IntMapreplace in class AbstractLong2IntMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public int replace(long key,
int value)
Long2IntMapreplace in interface Long2IntMapreplace in class AbstractLong2IntMapkey - the element that should be searched forvalue - the value to replace with.public int computeInt(long key,
LongIntUnaryOperator mappingFunction)
Long2IntMapcomputeInt in interface Long2IntMapcomputeInt in class AbstractLong2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic int computeIntIfAbsent(long key,
Long2IntFunction mappingFunction)
Long2IntMapcomputeIntIfAbsent in interface Long2IntMapcomputeIntIfAbsent in class AbstractLong2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic int computeIntIfPresent(long key,
LongIntUnaryOperator mappingFunction)
Long2IntMapcomputeIntIfPresent in interface Long2IntMapcomputeIntIfPresent in class AbstractLong2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic int mergeInt(long key,
int value,
IntIntUnaryOperator mappingFunction)
Long2IntMapmergeInt in interface Long2IntMapmergeInt in class AbstractLong2IntMapkey - 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(Long2IntMap m, IntIntUnaryOperator mappingFunction)
Long2IntMapmergeAllInt in interface Long2IntMapmergeAllInt in class AbstractLong2IntMapm - 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.Integer>size in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public void clear()
clear in interface java.util.Map<java.lang.Long,java.lang.Integer>clear in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public LongSortedSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Integer>keySet in interface java.util.SortedMap<java.lang.Long,java.lang.Integer>keySet in interface Long2IntMapkeySet in interface Long2IntSortedMapkeySet in class AbstractLong2IntMappublic ObjectSet<Long2IntMap.Entry> long2IntEntrySet()
Long2IntMaplong2IntEntrySet in interface Long2IntMappublic IntCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Integer>values in interface java.util.SortedMap<java.lang.Long,java.lang.Integer>values in interface Long2IntMapvalues in interface Long2IntSortedMapvalues in class AbstractLong2IntMappublic LongNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Long,java.lang.Integer>navigableKeySet in interface Long2IntNavigableMappublic Long2IntNavigableMap descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Long,java.lang.Integer>descendingMap in interface Long2IntNavigableMappublic LongNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Long,java.lang.Integer>descendingKeySet in interface Long2IntNavigableMappublic Long2IntNavigableMap subMap(long fromKey, boolean fromInclusive, long toKey, boolean toInclusive)
Long2IntNavigableMapsubMap in interface Long2IntNavigableMapfromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Long2IntNavigableMap headMap(long toKey, boolean inclusive)
Long2IntNavigableMapheadMap in interface Long2IntNavigableMaptoKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Long2IntNavigableMap tailMap(long fromKey, boolean inclusive)
Long2IntNavigableMaptailMap in interface Long2IntNavigableMapfromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic long lowerKey(long e)
Long2IntNavigableMaplowerKey in interface Long2IntNavigableMape - that should be compared with.public long floorKey(long e)
Long2IntNavigableMapfloorKey in interface Long2IntNavigableMape - that should be compared with.public long higherKey(long e)
Long2IntNavigableMaphigherKey in interface Long2IntNavigableMape - that should be compared with.public long ceilingKey(long e)
Long2IntNavigableMapceilingKey in interface Long2IntNavigableMape - that should be compared with.public Long2IntMap.Entry lowerEntry(long key)
Long2IntNavigableMaplowerEntry in interface Long2IntNavigableMapkey - that should be compared with.public Long2IntMap.Entry higherEntry(long key)
Long2IntNavigableMaphigherEntry in interface Long2IntNavigableMapkey - that should be compared with.public Long2IntMap.Entry floorEntry(long key)
Long2IntNavigableMapfloorEntry in interface Long2IntNavigableMapkey - that should be compared with.public Long2IntMap.Entry ceilingEntry(long key)
Long2IntNavigableMapceilingEntry in interface Long2IntNavigableMapkey - that should be compared with.