T - the type of elements maintained by this CollectionV - the type of elements maintained by this Collectionpublic class Object2ObjectRBTreeMap<T,V> extends AbstractObject2ObjectMap<T,V> implements Object2ObjectNavigableMap<T,V>
AbstractObject2ObjectMap.BasicEntry<T,V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2ObjectSortedMap.FastSortedSet<T,V>Object2ObjectMap.FastEntrySet<T,V>| Constructor and Description |
|---|
Object2ObjectRBTreeMap()
Default Constructor
|
Object2ObjectRBTreeMap(java.util.Comparator<T> comp)
Constructor that allows to define the sorter
|
Object2ObjectRBTreeMap(java.util.Map<? extends T,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2ObjectRBTreeMap(java.util.Map<? extends T,? extends V> map,
java.util.Comparator<T> comp)
A Helper constructor that has a custom sorter and allows to create a Map with exactly the same values as the provided map.
|
Object2ObjectRBTreeMap(Object2ObjectMap<T,V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2ObjectRBTreeMap(Object2ObjectMap<T,V> map,
java.util.Comparator<T> 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.
|
Object2ObjectRBTreeMap(T[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2ObjectRBTreeMap(T[] keys,
V[] values,
java.util.Comparator<T> comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
| Modifier and Type | Method and Description |
|---|---|
Object2ObjectMap.Entry<T,V> |
ceilingEntry(T key) |
T |
ceilingKey(T e) |
void |
clear() |
java.util.Comparator<T> |
comparator() |
V |
compute(T key,
ObjectObjectUnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(T key,
Object2ObjectFunction<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(T key,
ObjectObjectUnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
ObjectNavigableSet<T> |
descendingKeySet() |
Object2ObjectNavigableMap<T,V> |
descendingMap() |
Object2ObjectMap.Entry<T,V> |
firstEntry() |
T |
firstKey() |
V |
firstValue()
A method to get the first Value of a Map.
|
Object2ObjectMap.Entry<T,V> |
floorEntry(T key) |
T |
floorKey(T e) |
V |
getAndMoveToFirst(T key)
A Specific get method that allows to move teh given key/value int the first index.
|
V |
getAndMoveToLast(T key)
A Specific get method that allows to move teh given key/value int the last index.
|
T |
getDefaultMaxValue()
only used for primitives
|
T |
getDefaultMinValue()
only used for primitives
|
V |
getObject(T key)
Type Specific get function to reduce boxing/unboxing
|
V |
getOrDefault(java.lang.Object key,
V defaultValue) |
Object2ObjectNavigableMap<T,V> |
headMap(T toKey,
boolean inclusive) |
Object2ObjectMap.Entry<T,V> |
higherEntry(T key) |
T |
higherKey(T e) |
ObjectSortedSet<T> |
keySet() |
Object2ObjectMap.Entry<T,V> |
lastEntry() |
T |
lastKey() |
V |
lastValue()
A method to get the last Value of a Map.
|
Object2ObjectMap.Entry<T,V> |
lowerEntry(T key) |
T |
lowerKey(T e) |
V |
merge(T key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Object2ObjectMap<T,V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
boolean |
moveToFirst(T key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(T key)
A specific move method to move a given key/value to the last index.
|
ObjectNavigableSet<T> |
navigableKeySet() |
ObjectSet<Object2ObjectMap.Entry<T,V>> |
object2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Object2ObjectMap.Entry<T,V> |
pollFirstEntry() |
T |
pollFirstKey()
A method to get and remove the first Key of a Map.
|
Object2ObjectMap.Entry<T,V> |
pollLastEntry() |
T |
pollLastKey()
A method to get and remove the last Key of a Map.
|
V |
put(T key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putAndMoveToFirst(T key,
V value)
A customized put method that allows you to insert into the first index.
|
V |
putAndMoveToLast(T key,
V value)
A customized put method that allows you to insert into the last index.
|
V |
putIfAbsent(T key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
V |
remOrDefault(T key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
replace(T key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
Object2ObjectNavigableMap<T,V> |
subMap(T fromKey,
boolean fromInclusive,
T toKey,
boolean toInclusive) |
Object2ObjectNavigableMap<T,V> |
tailMap(T fromKey,
boolean inclusive) |
ObjectCollection<V> |
values() |
containsValue, entrySet, equals, forEach, get, getDefaultReturnValue, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValueheadMap, subMap, tailMapcompute, computeIfAbsent, computeIfPresent, entrySet, forEach, forEach, getDefaultReturnValue, merge, putAll, putAll, putAll, putAllIfAbsent, remove, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValueapplypublic Object2ObjectRBTreeMap()
public Object2ObjectRBTreeMap(java.util.Comparator<T> comp)
comp - the function that decides how the tree is sorted, can be nullpublic Object2ObjectRBTreeMap(T[] 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 Object2ObjectRBTreeMap(T[] keys, V[] values, java.util.Comparator<T> 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 Object2ObjectRBTreeMap(java.util.Map<? extends T,? extends V> map)
map - the values that should be present in the mappublic Object2ObjectRBTreeMap(java.util.Map<? extends T,? extends V> map, java.util.Comparator<T> comp)
map - the values that should be present in the mapcomp - the function that decides how the tree is sorted, can be nullpublic Object2ObjectRBTreeMap(Object2ObjectMap<T,V> map)
map - the values that should be present in the mappublic Object2ObjectRBTreeMap(Object2ObjectMap<T,V> map, java.util.Comparator<T> comp)
map - the values that should be present in the mapcomp - the function that decides how the tree is sorted, can be nullpublic T getDefaultMaxValue()
public T getDefaultMinValue()
public V put(T key, V value)
Object2ObjectMapput in interface java.util.Map<T,V>put in interface Object2ObjectMap<T,V>put in class java.util.AbstractMap<T,V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(T key, V value)
Object2ObjectMapputIfAbsent in interface java.util.Map<T,V>putIfAbsent in interface Object2ObjectMap<T,V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V putAndMoveToFirst(T key, V value)
Object2ObjectSortedMapputAndMoveToFirst in interface Object2ObjectSortedMap<T,V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(T key, V value)
Object2ObjectSortedMapputAndMoveToLast in interface Object2ObjectSortedMap<T,V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(T key)
Object2ObjectSortedMapmoveToFirst in interface Object2ObjectSortedMap<T,V>key - that should be moved to the first indexpublic boolean moveToLast(T key)
Object2ObjectSortedMapmoveToLast in interface Object2ObjectSortedMap<T,V>key - that should be moved to the first lastpublic V getAndMoveToFirst(T key)
Object2ObjectSortedMapgetAndMoveToFirst in interface Object2ObjectSortedMap<T,V>key - that is searched forpublic V getAndMoveToLast(T key)
Object2ObjectSortedMapgetAndMoveToLast in interface Object2ObjectSortedMap<T,V>key - that is searched forpublic java.util.Comparator<T> comparator()
comparator in interface java.util.SortedMap<T,V>comparator in interface Object2ObjectSortedMap<T,V>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,V>containsKey in class AbstractObject2ObjectMap<T,V>public V getObject(T key)
Object2ObjectFunctiongetObject in interface Object2ObjectFunction<T,V>key - the value that should be processedpublic V getOrDefault(java.lang.Object key, V defaultValue)
getOrDefault in interface java.util.Map<T,V>getOrDefault in class AbstractObject2ObjectMap<T,V>public T pollFirstKey()
Object2ObjectSortedMappollFirstKey in interface Object2ObjectSortedMap<T,V>public T pollLastKey()
Object2ObjectSortedMappollLastKey in interface Object2ObjectSortedMap<T,V>public Object2ObjectMap.Entry<T,V> firstEntry()
firstEntry in interface java.util.NavigableMap<T,V>firstEntry in interface Object2ObjectNavigableMap<T,V>public Object2ObjectMap.Entry<T,V> lastEntry()
public Object2ObjectMap.Entry<T,V> pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<T,V>pollFirstEntry in interface Object2ObjectNavigableMap<T,V>public Object2ObjectMap.Entry<T,V> pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<T,V>pollLastEntry in interface Object2ObjectNavigableMap<T,V>public V firstValue()
Object2ObjectSortedMapfirstValue in interface Object2ObjectSortedMap<T,V>public V lastValue()
Object2ObjectSortedMaplastValue in interface Object2ObjectSortedMap<T,V>public V rem(T key)
Object2ObjectMaprem in interface Object2ObjectMap<T,V>key - the element that should be removedpublic V remOrDefault(T key, V defaultValue)
Object2ObjectMapremOrDefault in interface Object2ObjectMap<T,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(java.lang.Object key,
java.lang.Object value)
public boolean replace(T key, V oldValue, V newValue)
Object2ObjectMapreplace in interface java.util.Map<T,V>replace in interface Object2ObjectMap<T,V>replace in class AbstractObject2ObjectMap<T,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(T key, V value)
Object2ObjectMapreplace in interface java.util.Map<T,V>replace in interface Object2ObjectMap<T,V>replace in class AbstractObject2ObjectMap<T,V>key - the element that should be searched forvalue - the value to replace with.public V compute(T key, ObjectObjectUnaryOperator<T,V> mappingFunction)
Object2ObjectMapcompute in interface Object2ObjectMap<T,V>compute in class AbstractObject2ObjectMap<T,V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(T key, Object2ObjectFunction<T,V> mappingFunction)
Object2ObjectMapcomputeIfAbsent in interface Object2ObjectMap<T,V>computeIfAbsent in class AbstractObject2ObjectMap<T,V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V computeIfPresent(T key, ObjectObjectUnaryOperator<T,V> mappingFunction)
Object2ObjectMapcomputeIfPresent in interface Object2ObjectMap<T,V>computeIfPresent in class AbstractObject2ObjectMap<T,V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(T key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Object2ObjectMapmerge in interface Object2ObjectMap<T,V>merge in class AbstractObject2ObjectMap<T,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(Object2ObjectMap<T,V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Object2ObjectMapmergeAll in interface Object2ObjectMap<T,V>mergeAll in class AbstractObject2ObjectMap<T,V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
public void clear()
public ObjectSortedSet<T> keySet()
public ObjectSet<Object2ObjectMap.Entry<T,V>> object2ObjectEntrySet()
Object2ObjectMapobject2ObjectEntrySet in interface Object2ObjectMap<T,V>public ObjectCollection<V> values()
public ObjectNavigableSet<T> navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<T,V>navigableKeySet in interface Object2ObjectNavigableMap<T,V>public Object2ObjectNavigableMap<T,V> descendingMap()
descendingMap in interface java.util.NavigableMap<T,V>descendingMap in interface Object2ObjectNavigableMap<T,V>public ObjectNavigableSet<T> descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<T,V>descendingKeySet in interface Object2ObjectNavigableMap<T,V>public Object2ObjectNavigableMap<T,V> subMap(T fromKey, boolean fromInclusive, T toKey, boolean toInclusive)
public Object2ObjectNavigableMap<T,V> headMap(T toKey, boolean inclusive)
public Object2ObjectNavigableMap<T,V> tailMap(T fromKey, boolean inclusive)
public Object2ObjectMap.Entry<T,V> lowerEntry(T key)
lowerEntry in interface java.util.NavigableMap<T,V>lowerEntry in interface Object2ObjectNavigableMap<T,V>public Object2ObjectMap.Entry<T,V> higherEntry(T key)
higherEntry in interface java.util.NavigableMap<T,V>higherEntry in interface Object2ObjectNavigableMap<T,V>public Object2ObjectMap.Entry<T,V> floorEntry(T key)
floorEntry in interface java.util.NavigableMap<T,V>floorEntry in interface Object2ObjectNavigableMap<T,V>public Object2ObjectMap.Entry<T,V> ceilingEntry(T key)
ceilingEntry in interface java.util.NavigableMap<T,V>ceilingEntry in interface Object2ObjectNavigableMap<T,V>