public class Long2LongAVLTreeMap extends AbstractLong2LongMap implements Long2LongNavigableMap
AbstractLong2LongMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2LongSortedMap.FastSortedSetLong2LongMap.BuilderCache, Long2LongMap.Entry, Long2LongMap.FastEntrySet, Long2LongMap.MapBuilder| Constructor and Description |
|---|
Long2LongAVLTreeMap()
Default Constructor
|
Long2LongAVLTreeMap(long[] keys,
long[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2LongAVLTreeMap(java.lang.Long[] keys,
java.lang.Long[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2LongAVLTreeMap(long[] keys,
long[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Long2LongAVLTreeMap(java.lang.Long[] keys,
java.lang.Long[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Long2LongAVLTreeMap(Long2LongMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2LongAVLTreeMap(Long2LongMap 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.
|
Long2LongAVLTreeMap(LongComparator comp)
Constructor that allows to define the sorter
|
Long2LongAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Long> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Long2LongAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Long> 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 |
|---|---|
long |
addTo(long key,
long value)
A Helper method to add a primitives together.
|
Long2LongMap.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() |
long |
computeLong(long key,
LongLongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfAbsent(long key,
LongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfPresent(long key,
LongLongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long key)
Type Specific method to reduce boxing/unboxing of values
|
Long2LongAVLTreeMap |
copy()
A Function that does a shallow clone of the Map itself.
|
LongNavigableSet |
descendingKeySet() |
Long2LongNavigableMap |
descendingMap() |
Long2LongMap.Entry |
firstEntry() |
long |
firstLongKey()
A method to get the first Key of a Map.
|
long |
firstLongValue()
A method to get the first Value of a Map.
|
Long2LongMap.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.
|
void |
forEach(LongLongConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
long |
get(long key)
A Type Specific get method to reduce boxing/unboxing
|
long |
getDefaultMaxValue()
A Helper method to get the max value for SubMaps.
|
long |
getDefaultMinValue()
A Helper method to get the min value for SubMaps.
|
long |
getOrDefault(long key,
long defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Long2LongNavigableMap |
headMap(long toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Long2LongMap.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.
|
LongNavigableSet |
keySet() |
Long2LongMap.Entry |
lastEntry() |
long |
lastLongKey()
A method to get the last Key of a Map.
|
long |
lastLongValue()
A method to get the last Value of a Map.
|
ObjectSet<Long2LongMap.Entry> |
long2LongEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Long2LongMap.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 |
mergeAllLong(Long2LongMap m,
LongLongUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
long |
mergeLong(long key,
long value,
LongLongUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
LongNavigableSet |
navigableKeySet() |
Long2LongMap.Entry |
pollFirstEntry() |
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
Long2LongMap.Entry |
pollLastEntry() |
long |
pollLastLongKey()
A method to get and remove the last Key of a Map.
|
long |
put(long key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
putIfAbsent(long key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long key,
long value)
Type Specific remove function to reduce boxing/unboxing
|
long |
removeOrDefault(long key,
long defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
long |
replace(long key,
long value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
long oldValue,
long 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() |
long |
subFrom(long key,
long value)
A Helper method to subtract from primitive from each other.
|
Long2LongNavigableMap |
subMap(long fromKey,
boolean fromInclusive,
long toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
long |
supplyLongIfAbsent(long key,
LongSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Long2LongNavigableMap |
tailMap(long 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, setDefaultReturnValueandThen, compose, identitypublic Long2LongAVLTreeMap()
public Long2LongAVLTreeMap(LongComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Long2LongAVLTreeMap(java.lang.Long[] 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 Long2LongAVLTreeMap(java.lang.Long[] keys,
java.lang.Long[] 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 Long2LongAVLTreeMap(long[] 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 Long2LongAVLTreeMap(long[] keys,
long[] 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 Long2LongAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Long> map)
map - the values that should be present in the mappublic Long2LongAVLTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Long> 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 Long2LongAVLTreeMap(Long2LongMap map)
map - the values that should be present in the mappublic Long2LongAVLTreeMap(Long2LongMap 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)
Long2LongNavigableMapsetDefaultMaxValue in interface Long2LongNavigableMapvalue - the new max valuepublic long getDefaultMaxValue()
Long2LongNavigableMapgetDefaultMaxValue in interface Long2LongNavigableMappublic void setDefaultMinValue(long value)
Long2LongNavigableMapsetDefaultMinValue in interface Long2LongNavigableMapvalue - the new min valuepublic long getDefaultMinValue()
Long2LongNavigableMapgetDefaultMinValue in interface Long2LongNavigableMappublic long put(long key,
long value)
Long2LongMapput in interface Long2LongMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public long putIfAbsent(long key,
long value)
Long2LongMapputIfAbsent in interface Long2LongMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public long addTo(long key,
long value)
Long2LongMapaddTo in interface Long2LongMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic long subFrom(long key,
long value)
Long2LongMapLong2LongMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Long2LongMapkey - that should be subtract fromvalue - that should be subtractpublic LongComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Long,java.lang.Long>comparator in interface Long2LongSortedMappublic boolean containsKey(long key)
Long2LongMapcontainsKey in interface Long2LongMapcontainsKey in class AbstractLong2LongMapkey - element that is searched forpublic long get(long key)
Long2LongMapget in interface Long2LongMapkey - the key that is searched forpublic long getOrDefault(long key,
long defaultValue)
Long2LongMapgetOrDefault in interface Long2LongMapgetOrDefault in class AbstractLong2LongMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic long firstLongKey()
Long2LongSortedMapfirstLongKey in interface Long2LongSortedMappublic long pollFirstLongKey()
Long2LongSortedMappollFirstLongKey in interface Long2LongSortedMappublic long lastLongKey()
Long2LongSortedMaplastLongKey in interface Long2LongSortedMappublic long pollLastLongKey()
Long2LongSortedMappollLastLongKey in interface Long2LongSortedMappublic Long2LongMap.Entry firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Long>firstEntry in interface Long2LongNavigableMappublic Long2LongMap.Entry lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Long>lastEntry in interface Long2LongNavigableMappublic Long2LongMap.Entry pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Long>pollFirstEntry in interface Long2LongNavigableMappublic Long2LongMap.Entry pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Long,java.lang.Long>pollLastEntry in interface Long2LongNavigableMappublic long firstLongValue()
Long2LongSortedMapfirstLongValue in interface Long2LongSortedMappublic long lastLongValue()
Long2LongSortedMaplastLongValue in interface Long2LongSortedMappublic long remove(long key)
Long2LongMapremove in interface Long2LongMapkey - the element that should be removedpublic long removeOrDefault(long key,
long defaultValue)
Long2LongMapremoveOrDefault in interface Long2LongMapkey - 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,
long value)
Long2LongMapremove in interface Long2LongMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(long key,
long oldValue,
long newValue)
Long2LongMapreplace in interface Long2LongMapreplace in class AbstractLong2LongMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public long replace(long key,
long value)
Long2LongMapreplace in interface Long2LongMapreplace in class AbstractLong2LongMapkey - the element that should be searched forvalue - the value to replace with.public long computeLong(long key,
LongLongUnaryOperator mappingFunction)
Long2LongMapcomputeLong in interface Long2LongMapcomputeLong in class AbstractLong2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic long computeLongIfAbsent(long key,
LongUnaryOperator mappingFunction)
Long2LongMapcomputeLongIfAbsent in interface Long2LongMapcomputeLongIfAbsent in class AbstractLong2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic long supplyLongIfAbsent(long key,
LongSupplier valueProvider)
Long2LongMapsupplyLongIfAbsent in interface Long2LongMapsupplyLongIfAbsent in class AbstractLong2LongMapkey - the key that should be computedvalueProvider - the value if not presentpublic long computeLongIfPresent(long key,
LongLongUnaryOperator mappingFunction)
Long2LongMapcomputeLongIfPresent in interface Long2LongMapcomputeLongIfPresent in class AbstractLong2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic long mergeLong(long key,
long value,
LongLongUnaryOperator mappingFunction)
Long2LongMapmergeLong in interface Long2LongMapmergeLong in class AbstractLong2LongMapkey - 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(Long2LongMap m, LongLongUnaryOperator mappingFunction)
Long2LongMapmergeAllLong in interface Long2LongMapmergeAllLong in class AbstractLong2LongMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void forEach(LongLongConsumer action)
Long2LongMapforEach in interface Long2LongMapforEach in class AbstractLong2LongMapaction - processor of the values that are iterator overpublic int size()
size in interface java.util.Map<java.lang.Long,java.lang.Long>size in class java.util.AbstractMap<java.lang.Long,java.lang.Long>public void clear()
clear in interface java.util.Map<java.lang.Long,java.lang.Long>clear in class java.util.AbstractMap<java.lang.Long,java.lang.Long>public Long2LongAVLTreeMap copy()
Long2LongMapcopy in interface Long2LongMapcopy in interface Long2LongNavigableMapcopy in interface Long2LongSortedMapcopy in class AbstractLong2LongMappublic LongNavigableSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Long>keySet in interface java.util.SortedMap<java.lang.Long,java.lang.Long>keySet in interface Long2LongMapkeySet in interface Long2LongNavigableMapkeySet in interface Long2LongSortedMapkeySet in class AbstractLong2LongMappublic ObjectSet<Long2LongMap.Entry> long2LongEntrySet()
Long2LongMaplong2LongEntrySet in interface Long2LongMappublic LongCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Long>values in interface java.util.SortedMap<java.lang.Long,java.lang.Long>values in interface Long2LongMapvalues in interface Long2LongSortedMapvalues in class AbstractLong2LongMappublic LongNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Long,java.lang.Long>navigableKeySet in interface Long2LongNavigableMappublic Long2LongNavigableMap descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Long,java.lang.Long>descendingMap in interface Long2LongNavigableMappublic LongNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Long,java.lang.Long>descendingKeySet in interface Long2LongNavigableMappublic Long2LongNavigableMap subMap(long fromKey, boolean fromInclusive, long toKey, boolean toInclusive)
Long2LongNavigableMapsubMap in interface Long2LongNavigableMapfromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Long2LongNavigableMap headMap(long toKey, boolean inclusive)
Long2LongNavigableMapheadMap in interface Long2LongNavigableMaptoKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Long2LongNavigableMap tailMap(long fromKey, boolean inclusive)
Long2LongNavigableMaptailMap in interface Long2LongNavigableMapfromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic long lowerKey(long e)
Long2LongNavigableMaplowerKey in interface Long2LongNavigableMape - that should be compared with.public long floorKey(long e)
Long2LongNavigableMapfloorKey in interface Long2LongNavigableMape - that should be compared with.public long higherKey(long e)
Long2LongNavigableMaphigherKey in interface Long2LongNavigableMape - that should be compared with.public long ceilingKey(long e)
Long2LongNavigableMapceilingKey in interface Long2LongNavigableMape - that should be compared with.public Long2LongMap.Entry lowerEntry(long key)
Long2LongNavigableMaplowerEntry in interface Long2LongNavigableMapkey - that should be compared with.public Long2LongMap.Entry higherEntry(long key)
Long2LongNavigableMaphigherEntry in interface Long2LongNavigableMapkey - that should be compared with.public Long2LongMap.Entry floorEntry(long key)
Long2LongNavigableMapfloorEntry in interface Long2LongNavigableMapkey - that should be compared with.public Long2LongMap.Entry ceilingEntry(long key)
Long2LongNavigableMapceilingEntry in interface Long2LongNavigableMapkey - that should be compared with.