V - the type of elements maintained by this Collectionpublic class Long2ObjectRBTreeMap<V> extends AbstractLong2ObjectMap<V> implements Long2ObjectNavigableMap<V>
AbstractLong2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ObjectSortedMap.FastSortedSet<V>Long2ObjectMap.BuilderCache<V>, Long2ObjectMap.Entry<V>, Long2ObjectMap.FastEntrySet<V>, Long2ObjectMap.MapBuilder| Constructor and Description |
|---|
Long2ObjectRBTreeMap()
Default Constructor
|
Long2ObjectRBTreeMap(long[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2ObjectRBTreeMap(java.lang.Long[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2ObjectRBTreeMap(long[] keys,
V[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Long2ObjectRBTreeMap(java.lang.Long[] keys,
V[] values,
LongComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Long2ObjectRBTreeMap(Long2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2ObjectRBTreeMap(Long2ObjectMap<V> 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.
|
Long2ObjectRBTreeMap(LongComparator comp)
Constructor that allows to define the sorter
|
Long2ObjectRBTreeMap(java.util.Map<? extends java.lang.Long,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Long2ObjectRBTreeMap(java.util.Map<? extends java.lang.Long,? extends V> 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 |
|---|---|
Long2ObjectMap.Entry<V> |
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() |
V |
compute(long key,
LongObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(long key,
Long2ObjectFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(long key,
LongObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long key)
Type Specific method to reduce boxing/unboxing of values
|
Long2ObjectRBTreeMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
LongNavigableSet |
descendingKeySet() |
Long2ObjectNavigableMap<V> |
descendingMap() |
Long2ObjectMap.Entry<V> |
firstEntry() |
long |
firstLongKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
Long2ObjectMap.Entry<V> |
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(LongObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
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.
|
V |
getOrDefault(long key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Long2ObjectNavigableMap<V> |
headMap(long toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Long2ObjectMap.Entry<V> |
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() |
Long2ObjectMap.Entry<V> |
lastEntry() |
long |
lastLongKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
ObjectSet<Long2ObjectMap.Entry<V>> |
long2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Long2ObjectMap.Entry<V> |
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.
|
V |
merge(long key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Long2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
LongNavigableSet |
navigableKeySet() |
Long2ObjectMap.Entry<V> |
pollFirstEntry() |
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
Long2ObjectMap.Entry<V> |
pollLastEntry() |
long |
pollLastLongKey()
A method to get and remove the last Key of a Map.
|
V |
put(long key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putIfAbsent(long key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
removeOrDefault(long key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
replace(long key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
V oldValue,
V 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() |
Long2ObjectNavigableMap<V> |
subMap(long fromKey,
boolean fromInclusive,
long toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
V |
supplyIfAbsent(long key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Long2ObjectNavigableMap<V> |
tailMap(long fromKey,
boolean inclusive)
A Type Specific TailMap method to reduce boxing/unboxing
|
ObjectCollection<V> |
values() |
containsValue, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceObjects, replaceObjects, setDefaultReturnValueceilingEntry, ceilingKey, floorEntry, floorKey, headMap, headMap, headMap, higherEntry, higherKey, lowerEntry, lowerKey, subMap, subMap, subMap, synchronize, synchronize, tailMap, tailMap, tailMap, unmodifiablefirstKey, lastKeybuilder, compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, remove, remove, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValueapplypublic Long2ObjectRBTreeMap()
public Long2ObjectRBTreeMap(LongComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Long2ObjectRBTreeMap(java.lang.Long[] keys,
V[] 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 Long2ObjectRBTreeMap(java.lang.Long[] keys,
V[] 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 Long2ObjectRBTreeMap(long[] keys,
V[] 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 Long2ObjectRBTreeMap(long[] keys,
V[] 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 Long2ObjectRBTreeMap(java.util.Map<? extends java.lang.Long,? extends V> map)
map - the values that should be present in the mappublic Long2ObjectRBTreeMap(java.util.Map<? extends java.lang.Long,? extends V> 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 Long2ObjectRBTreeMap(Long2ObjectMap<V> map)
map - the values that should be present in the mappublic Long2ObjectRBTreeMap(Long2ObjectMap<V> 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)
Long2ObjectNavigableMapsetDefaultMaxValue in interface Long2ObjectNavigableMap<V>value - the new max valuepublic long getDefaultMaxValue()
Long2ObjectNavigableMapgetDefaultMaxValue in interface Long2ObjectNavigableMap<V>public void setDefaultMinValue(long value)
Long2ObjectNavigableMapsetDefaultMinValue in interface Long2ObjectNavigableMap<V>value - the new min valuepublic long getDefaultMinValue()
Long2ObjectNavigableMapgetDefaultMinValue in interface Long2ObjectNavigableMap<V>public V put(long key, V value)
Long2ObjectMapput in interface Long2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(long key, V value)
Long2ObjectMapputIfAbsent in interface Long2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public LongComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Long,V>comparator in interface Long2ObjectSortedMap<V>public boolean containsKey(long key)
Long2ObjectMapcontainsKey in interface Long2ObjectMap<V>containsKey in class AbstractLong2ObjectMap<V>key - element that is searched forpublic V get(long key)
Long2ObjectMapget in interface Long2ObjectFunction<V>get in interface Long2ObjectMap<V>key - the key that is searched forpublic V getOrDefault(long key, V defaultValue)
Long2ObjectMapgetOrDefault in interface Long2ObjectMap<V>getOrDefault in class AbstractLong2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic long firstLongKey()
Long2ObjectSortedMapfirstLongKey in interface Long2ObjectSortedMap<V>public long pollFirstLongKey()
Long2ObjectSortedMappollFirstLongKey in interface Long2ObjectSortedMap<V>public long lastLongKey()
Long2ObjectSortedMaplastLongKey in interface Long2ObjectSortedMap<V>public long pollLastLongKey()
Long2ObjectSortedMappollLastLongKey in interface Long2ObjectSortedMap<V>public Long2ObjectMap.Entry<V> firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Long,V>firstEntry in interface Long2ObjectNavigableMap<V>public Long2ObjectMap.Entry<V> lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Long,V>lastEntry in interface Long2ObjectNavigableMap<V>public Long2ObjectMap.Entry<V> pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Long,V>pollFirstEntry in interface Long2ObjectNavigableMap<V>public Long2ObjectMap.Entry<V> pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Long,V>pollLastEntry in interface Long2ObjectNavigableMap<V>public V firstValue()
Long2ObjectSortedMapfirstValue in interface Long2ObjectSortedMap<V>public V lastValue()
Long2ObjectSortedMaplastValue in interface Long2ObjectSortedMap<V>public V remove(long key)
Long2ObjectMapremove in interface Long2ObjectMap<V>key - the element that should be removedpublic V removeOrDefault(long key, V defaultValue)
Long2ObjectMapremoveOrDefault in interface Long2ObjectMap<V>key - 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,
V value)
Long2ObjectMapremove in interface Long2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(long key,
V oldValue,
V newValue)
Long2ObjectMapreplace in interface Long2ObjectMap<V>replace in class AbstractLong2ObjectMap<V>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public V replace(long key, V value)
Long2ObjectMapreplace in interface Long2ObjectMap<V>replace in class AbstractLong2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(long key, LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapcompute in interface Long2ObjectMap<V>compute in class AbstractLong2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(long key, Long2ObjectFunction<V> mappingFunction)
Long2ObjectMapcomputeIfAbsent in interface Long2ObjectMap<V>computeIfAbsent in class AbstractLong2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V supplyIfAbsent(long key, ObjectSupplier<V> valueProvider)
Long2ObjectMapsupplyIfAbsent in interface Long2ObjectMap<V>supplyIfAbsent in class AbstractLong2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(long key, LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapcomputeIfPresent in interface Long2ObjectMap<V>computeIfPresent in class AbstractLong2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(long key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Long2ObjectMapmerge in interface Long2ObjectMap<V>merge in class AbstractLong2ObjectMap<V>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAll(Long2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Long2ObjectMapmergeAll in interface Long2ObjectMap<V>mergeAll in class AbstractLong2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void forEach(LongObjectConsumer<V> action)
Long2ObjectMapforEach in interface Long2ObjectMap<V>forEach in class AbstractLong2ObjectMap<V>action - processor of the values that are iterator overpublic int size()
public void clear()
public Long2ObjectRBTreeMap<V> copy()
Long2ObjectMapcopy in interface Long2ObjectMap<V>copy in interface Long2ObjectNavigableMap<V>copy in interface Long2ObjectSortedMap<V>copy in class AbstractLong2ObjectMap<V>public LongNavigableSet keySet()
keySet in interface java.util.Map<java.lang.Long,V>keySet in interface java.util.SortedMap<java.lang.Long,V>keySet in interface Long2ObjectMap<V>keySet in interface Long2ObjectNavigableMap<V>keySet in interface Long2ObjectSortedMap<V>keySet in class AbstractLong2ObjectMap<V>public ObjectSet<Long2ObjectMap.Entry<V>> long2ObjectEntrySet()
Long2ObjectMaplong2ObjectEntrySet in interface Long2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Long,V>values in interface java.util.SortedMap<java.lang.Long,V>values in interface Long2ObjectMap<V>values in interface Long2ObjectSortedMap<V>values in class AbstractLong2ObjectMap<V>public LongNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Long,V>navigableKeySet in interface Long2ObjectNavigableMap<V>public Long2ObjectNavigableMap<V> descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Long,V>descendingMap in interface Long2ObjectNavigableMap<V>public LongNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Long,V>descendingKeySet in interface Long2ObjectNavigableMap<V>public Long2ObjectNavigableMap<V> subMap(long fromKey, boolean fromInclusive, long toKey, boolean toInclusive)
Long2ObjectNavigableMapsubMap in interface Long2ObjectNavigableMap<V>fromKey - where the submap should startfromInclusive - if the fromKey is inclusive or nottoKey - where the subMap should endtoInclusive - if the toKey is inclusive or notpublic Long2ObjectNavigableMap<V> headMap(long toKey, boolean inclusive)
Long2ObjectNavigableMapheadMap in interface Long2ObjectNavigableMap<V>toKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Long2ObjectNavigableMap<V> tailMap(long fromKey, boolean inclusive)
Long2ObjectNavigableMaptailMap in interface Long2ObjectNavigableMap<V>fromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic long lowerKey(long e)
Long2ObjectNavigableMaplowerKey in interface Long2ObjectNavigableMap<V>e - that should be compared with.public long floorKey(long e)
Long2ObjectNavigableMapfloorKey in interface Long2ObjectNavigableMap<V>e - that should be compared with.public long higherKey(long e)
Long2ObjectNavigableMaphigherKey in interface Long2ObjectNavigableMap<V>e - that should be compared with.public long ceilingKey(long e)
Long2ObjectNavigableMapceilingKey in interface Long2ObjectNavigableMap<V>e - that should be compared with.public Long2ObjectMap.Entry<V> lowerEntry(long key)
Long2ObjectNavigableMaplowerEntry in interface Long2ObjectNavigableMap<V>key - that should be compared with.public Long2ObjectMap.Entry<V> higherEntry(long key)
Long2ObjectNavigableMaphigherEntry in interface Long2ObjectNavigableMap<V>key - that should be compared with.public Long2ObjectMap.Entry<V> floorEntry(long key)
Long2ObjectNavigableMapfloorEntry in interface Long2ObjectNavigableMap<V>key - that should be compared with.public Long2ObjectMap.Entry<V> ceilingEntry(long key)
Long2ObjectNavigableMapceilingEntry in interface Long2ObjectNavigableMap<V>key - that should be compared with.