public class Long2IntRBTreeMap extends AbstractLong2IntMap implements Long2IntNavigableMap
AbstractLong2IntMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2IntSortedMap.FastSortedSetLong2IntMap.BuilderCache, Long2IntMap.Entry, Long2IntMap.FastEntrySet, Long2IntMap.MapBuilder| Constructor and Description |
|---|
Long2IntRBTreeMap()
Default Constructor
|
Long2IntRBTreeMap(long[] keys,
int[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2IntRBTreeMap(long[] keys,
int[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Long2IntRBTreeMap(java.lang.Long[] keys,
java.lang.Integer[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2IntRBTreeMap(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)
|
Long2IntRBTreeMap(Long2IntMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2IntRBTreeMap(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.
|
Long2IntRBTreeMap(LongComparator comp)
Constructor that allows to define the sorter
|
Long2IntRBTreeMap(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.
|
Long2IntRBTreeMap(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
|
Long2IntRBTreeMap |
copy()
A Function that does a shallow clone of the Map itself.
|
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.
|
void |
forEach(LongIntConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
int |
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.
|
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.
|
LongNavigableSet |
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
|
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 |
putIfAbsent(long key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
int |
removeOrDefault(long key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
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() |
int |
subFrom(long key,
int value)
A Helper method to subtract from primitive from each other.
|
Long2IntNavigableMap |
subMap(long fromKey,
boolean fromInclusive,
long toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
int |
supplyIntIfAbsent(long key,
IntSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Long2IntNavigableMap |
tailMap(long 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, setDefaultReturnValueapplyAsIntpublic Long2IntRBTreeMap()
public Long2IntRBTreeMap(LongComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Long2IntRBTreeMap(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 Long2IntRBTreeMap(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 Long2IntRBTreeMap(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 Long2IntRBTreeMap(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 Long2IntRBTreeMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Integer> map)
map - the values that should be present in the mappublic Long2IntRBTreeMap(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 Long2IntRBTreeMap(Long2IntMap map)
map - the values that should be present in the mappublic Long2IntRBTreeMap(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 subFrom(long key,
int value)
Long2IntMapLong2IntMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Long2IntMapkey - that should be subtract fromvalue - that should be subtractpublic 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 get(long key)
Long2IntMapget in interface Long2IntFunctionget 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 remove(long key)
Long2IntMapremove in interface Long2IntMapkey - the element that should be removedpublic int removeOrDefault(long key,
int defaultValue)
Long2IntMapremoveOrDefault 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 supplyIntIfAbsent(long key,
IntSupplier valueProvider)
Long2IntMapsupplyIntIfAbsent in interface Long2IntMapsupplyIntIfAbsent in class AbstractLong2IntMapkey - the key that should be computedvalueProvider - 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 void forEach(LongIntConsumer action)
Long2IntMapforEach in interface Long2IntMapforEach in class AbstractLong2IntMapaction - processor of the values that are iterator overpublic 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 Long2IntRBTreeMap copy()
Long2IntMapcopy in interface Long2IntMapcopy in interface Long2IntNavigableMapcopy in interface Long2IntSortedMapcopy in class AbstractLong2IntMappublic LongNavigableSet 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 Long2IntNavigableMapkeySet 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.