V - the keyType of elements maintained by this Collectionpublic class Int2ObjectAVLTreeMap<V> extends AbstractInt2ObjectMap<V> implements Int2ObjectNavigableMap<V>
AbstractInt2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2ObjectSortedMap.FastSortedSet<V>Int2ObjectMap.BuilderCache<V>, Int2ObjectMap.Entry<V>, Int2ObjectMap.FastEntrySet<V>, Int2ObjectMap.MapBuilder| Constructor and Description |
|---|
Int2ObjectAVLTreeMap()
Default Constructor
|
Int2ObjectAVLTreeMap(int[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Int2ObjectAVLTreeMap(int[] keys,
V[] values,
IntComparator comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Int2ObjectAVLTreeMap(Int2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ObjectAVLTreeMap(Int2ObjectMap<V> 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.
|
Int2ObjectAVLTreeMap(IntComparator comp)
Constructor that allows to define the sorter
|
Int2ObjectAVLTreeMap(java.lang.Integer[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ObjectAVLTreeMap(java.lang.Integer[] keys,
V[] values,
IntComparator comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
Int2ObjectAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Int2ObjectAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends V> 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 |
|---|---|
Int2ObjectMap.Entry<V> |
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() |
V |
compute(int key,
IntObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(int key,
IntFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(int key,
IntObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(int key)
Type Specific method to reduce boxing/unboxing of values
|
Int2ObjectAVLTreeMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
IntNavigableSet |
descendingKeySet() |
Int2ObjectNavigableMap<V> |
descendingMap() |
Int2ObjectMap.Entry<V> |
firstEntry() |
int |
firstIntKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
Int2ObjectMap.Entry<V> |
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(IntObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
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.
|
V |
getOrDefault(int key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Int2ObjectNavigableMap<V> |
headMap(int toKey,
boolean inclusive)
A Type Specific HeadMap method to reduce boxing/unboxing
|
Int2ObjectMap.Entry<V> |
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<Int2ObjectMap.Entry<V>> |
int2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntNavigableSet |
keySet() |
Int2ObjectMap.Entry<V> |
lastEntry() |
int |
lastIntKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
Int2ObjectMap.Entry<V> |
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.
|
V |
merge(int key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Int2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
IntNavigableSet |
navigableKeySet() |
Int2ObjectMap.Entry<V> |
pollFirstEntry() |
int |
pollFirstIntKey()
A method to get and remove the first Key of a Map.
|
Int2ObjectMap.Entry<V> |
pollLastEntry() |
int |
pollLastIntKey()
A method to get and remove the last Key of a Map.
|
V |
put(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putIfAbsent(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
removeOrDefault(int key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
replace(int key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
V oldValue,
V 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() |
Int2ObjectNavigableMap<V> |
subMap(int fromKey,
boolean fromInclusive,
int toKey,
boolean toInclusive)
A Type Specific SubMap method to reduce boxing/unboxing
|
V |
supplyIfAbsent(int key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Int2ObjectNavigableMap<V> |
tailMap(int 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, lastKeyapply, builder, compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, remove, remove, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic Int2ObjectAVLTreeMap()
public Int2ObjectAVLTreeMap(IntComparator comp)
comp - the function that decides how the tree is sorted, can be nullpublic Int2ObjectAVLTreeMap(java.lang.Integer[] 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 Int2ObjectAVLTreeMap(java.lang.Integer[] keys,
V[] 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 Int2ObjectAVLTreeMap(int[] 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 Int2ObjectAVLTreeMap(int[] keys,
V[] 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 Int2ObjectAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends V> map)
map - the values that should be present in the mappublic Int2ObjectAVLTreeMap(java.util.Map<? extends java.lang.Integer,? extends V> 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 Int2ObjectAVLTreeMap(Int2ObjectMap<V> map)
map - the values that should be present in the mappublic Int2ObjectAVLTreeMap(Int2ObjectMap<V> 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)
Int2ObjectNavigableMapsetDefaultMaxValue in interface Int2ObjectNavigableMap<V>value - the new max valuepublic int getDefaultMaxValue()
Int2ObjectNavigableMapgetDefaultMaxValue in interface Int2ObjectNavigableMap<V>public void setDefaultMinValue(int value)
Int2ObjectNavigableMapsetDefaultMinValue in interface Int2ObjectNavigableMap<V>value - the new min valuepublic int getDefaultMinValue()
Int2ObjectNavigableMapgetDefaultMinValue in interface Int2ObjectNavigableMap<V>public V put(int key, V value)
Int2ObjectMapput in interface Int2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(int key, V value)
Int2ObjectMapputIfAbsent in interface Int2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public IntComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Integer,V>comparator in interface Int2ObjectSortedMap<V>public boolean containsKey(int key)
Int2ObjectMapcontainsKey in interface Int2ObjectMap<V>containsKey in class AbstractInt2ObjectMap<V>key - element that is searched forpublic V get(int key)
Int2ObjectMapget in interface Int2ObjectMap<V>key - the key that is searched forpublic V getOrDefault(int key, V defaultValue)
Int2ObjectMapgetOrDefault in interface Int2ObjectMap<V>getOrDefault in class AbstractInt2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic int firstIntKey()
Int2ObjectSortedMapfirstIntKey in interface Int2ObjectSortedMap<V>public int pollFirstIntKey()
Int2ObjectSortedMappollFirstIntKey in interface Int2ObjectSortedMap<V>public int lastIntKey()
Int2ObjectSortedMaplastIntKey in interface Int2ObjectSortedMap<V>public int pollLastIntKey()
Int2ObjectSortedMappollLastIntKey in interface Int2ObjectSortedMap<V>public Int2ObjectMap.Entry<V> firstEntry()
firstEntry in interface java.util.NavigableMap<java.lang.Integer,V>firstEntry in interface Int2ObjectNavigableMap<V>public Int2ObjectMap.Entry<V> lastEntry()
lastEntry in interface java.util.NavigableMap<java.lang.Integer,V>lastEntry in interface Int2ObjectNavigableMap<V>public Int2ObjectMap.Entry<V> pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<java.lang.Integer,V>pollFirstEntry in interface Int2ObjectNavigableMap<V>public Int2ObjectMap.Entry<V> pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<java.lang.Integer,V>pollLastEntry in interface Int2ObjectNavigableMap<V>public V firstValue()
Int2ObjectSortedMapfirstValue in interface Int2ObjectSortedMap<V>public V lastValue()
Int2ObjectSortedMaplastValue in interface Int2ObjectSortedMap<V>public V remove(int key)
Int2ObjectMapremove in interface Int2ObjectMap<V>key - the element that should be removedpublic V removeOrDefault(int key, V defaultValue)
Int2ObjectMapremoveOrDefault in interface Int2ObjectMap<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(int key,
V value)
Int2ObjectMapremove in interface Int2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(int key,
V oldValue,
V newValue)
Int2ObjectMapreplace in interface Int2ObjectMap<V>replace in class AbstractInt2ObjectMap<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(int key, V value)
Int2ObjectMapreplace in interface Int2ObjectMap<V>replace in class AbstractInt2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcompute in interface Int2ObjectMap<V>compute in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(int key, IntFunction<V> mappingFunction)
Int2ObjectMapcomputeIfAbsent in interface Int2ObjectMap<V>computeIfAbsent in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V supplyIfAbsent(int key, ObjectSupplier<V> valueProvider)
Int2ObjectMapsupplyIfAbsent in interface Int2ObjectMap<V>supplyIfAbsent in class AbstractInt2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcomputeIfPresent in interface Int2ObjectMap<V>computeIfPresent in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(int key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmerge in interface Int2ObjectMap<V>merge in class AbstractInt2ObjectMap<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(Int2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmergeAll in interface Int2ObjectMap<V>mergeAll in class AbstractInt2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void forEach(IntObjectConsumer<V> action)
Int2ObjectMapforEach in interface Int2ObjectMap<V>forEach in class AbstractInt2ObjectMap<V>action - processor of the values that are iterator overpublic int size()
public void clear()
public Int2ObjectAVLTreeMap<V> copy()
Int2ObjectMapcopy in interface Int2ObjectMap<V>copy in interface Int2ObjectNavigableMap<V>copy in interface Int2ObjectSortedMap<V>copy in class AbstractInt2ObjectMap<V>public IntNavigableSet keySet()
keySet in interface java.util.Map<java.lang.Integer,V>keySet in interface java.util.SortedMap<java.lang.Integer,V>keySet in interface Int2ObjectMap<V>keySet in interface Int2ObjectNavigableMap<V>keySet in interface Int2ObjectSortedMap<V>keySet in class AbstractInt2ObjectMap<V>public ObjectSet<Int2ObjectMap.Entry<V>> int2ObjectEntrySet()
Int2ObjectMapint2ObjectEntrySet in interface Int2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Integer,V>values in interface java.util.SortedMap<java.lang.Integer,V>values in interface Int2ObjectMap<V>values in interface Int2ObjectSortedMap<V>values in class AbstractInt2ObjectMap<V>public IntNavigableSet navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<java.lang.Integer,V>navigableKeySet in interface Int2ObjectNavigableMap<V>public Int2ObjectNavigableMap<V> descendingMap()
descendingMap in interface java.util.NavigableMap<java.lang.Integer,V>descendingMap in interface Int2ObjectNavigableMap<V>public IntNavigableSet descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<java.lang.Integer,V>descendingKeySet in interface Int2ObjectNavigableMap<V>public Int2ObjectNavigableMap<V> subMap(int fromKey, boolean fromInclusive, int toKey, boolean toInclusive)
Int2ObjectNavigableMapsubMap in interface Int2ObjectNavigableMap<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 Int2ObjectNavigableMap<V> headMap(int toKey, boolean inclusive)
Int2ObjectNavigableMapheadMap in interface Int2ObjectNavigableMap<V>toKey - where the HeadMap should endinclusive - if the toKey is inclusive or notpublic Int2ObjectNavigableMap<V> tailMap(int fromKey, boolean inclusive)
Int2ObjectNavigableMaptailMap in interface Int2ObjectNavigableMap<V>fromKey - where the TailMap should startinclusive - if the fromKey is inclusive or notpublic int lowerKey(int e)
Int2ObjectNavigableMaplowerKey in interface Int2ObjectNavigableMap<V>e - that should be compared with.public int floorKey(int e)
Int2ObjectNavigableMapfloorKey in interface Int2ObjectNavigableMap<V>e - that should be compared with.public int higherKey(int e)
Int2ObjectNavigableMaphigherKey in interface Int2ObjectNavigableMap<V>e - that should be compared with.public int ceilingKey(int e)
Int2ObjectNavigableMapceilingKey in interface Int2ObjectNavigableMap<V>e - that should be compared with.public Int2ObjectMap.Entry<V> lowerEntry(int key)
Int2ObjectNavigableMaplowerEntry in interface Int2ObjectNavigableMap<V>key - that should be compared with.public Int2ObjectMap.Entry<V> higherEntry(int key)
Int2ObjectNavigableMaphigherEntry in interface Int2ObjectNavigableMap<V>key - that should be compared with.public Int2ObjectMap.Entry<V> floorEntry(int key)
Int2ObjectNavigableMapfloorEntry in interface Int2ObjectNavigableMap<V>key - that should be compared with.public Int2ObjectMap.Entry<V> ceilingEntry(int key)
Int2ObjectNavigableMapceilingEntry in interface Int2ObjectNavigableMap<V>key - that should be compared with.