T - the keyType of elements maintained by this Collectionpublic class Object2LongRBTreeMap<T> extends AbstractObject2LongMap<T> implements Object2LongNavigableMap<T>
AbstractObject2LongMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2LongSortedMap.FastSortedSet<T>Object2LongMap.BuilderCache<T>, Object2LongMap.Entry<T>, Object2LongMap.FastEntrySet<T>, Object2LongMap.MapBuilder| Constructor and Description |
|---|
Object2LongRBTreeMap()
Default Constructor
|
Object2LongRBTreeMap(java.util.Comparator<T> comp)
Constructor that allows to define the sorter
|
Object2LongRBTreeMap(java.util.Map<? extends T,? extends java.lang.Long> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2LongRBTreeMap(java.util.Map<? extends T,? extends java.lang.Long> 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.
|
Object2LongRBTreeMap(Object2LongMap<T> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2LongRBTreeMap(Object2LongMap<T> 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.
|
Object2LongRBTreeMap(T[] keys,
long[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2LongRBTreeMap(T[] keys,
java.lang.Long[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Object2LongRBTreeMap(T[] keys,
long[] values,
java.util.Comparator<T> comp)
Helper constructor that has a custom sorter and allow to create a map from unboxed values
|
Object2LongRBTreeMap(T[] keys,
java.lang.Long[] values,
java.util.Comparator<T> comp)
Helper constructor that has a custom sorter and allow to create a map from boxed values (it will unbox them)
|
| Modifier and Type | Method and Description |
|---|---|
long |
addTo(T key,
long value)
A Helper method to add a primitives together.
|
Object2LongMap.Entry<T> |
ceilingEntry(T key) |
T |
ceilingKey(T e) |
void |
clear() |
java.util.Comparator<T> |
comparator() |
long |
computeLong(T key,
ObjectLongUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfAbsent(T key,
ToLongFunction<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfPresent(T key,
ObjectLongUnaryOperator<T> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
Object2LongRBTreeMap<T> |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectNavigableSet<T> |
descendingKeySet() |
Object2LongNavigableMap<T> |
descendingMap() |
Object2LongMap.Entry<T> |
firstEntry() |
T |
firstKey() |
long |
firstLongValue()
A method to get the first Value of a Map.
|
Object2LongMap.Entry<T> |
floorEntry(T key) |
T |
floorKey(T e) |
void |
forEach(ObjectLongConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
T |
getDefaultMaxValue()
only used for primitives
|
T |
getDefaultMinValue()
only used for primitives
|
long |
getLong(T key)
A Type Specific get method to reduce boxing/unboxing
|
long |
getOrDefault(T key,
long defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Object2LongNavigableMap<T> |
headMap(T toKey,
boolean inclusive) |
Object2LongMap.Entry<T> |
higherEntry(T key) |
T |
higherKey(T e) |
ObjectNavigableSet<T> |
keySet() |
Object2LongMap.Entry<T> |
lastEntry() |
T |
lastKey() |
long |
lastLongValue()
A method to get the last Value of a Map.
|
Object2LongMap.Entry<T> |
lowerEntry(T key) |
T |
lowerKey(T e) |
void |
mergeAllLong(Object2LongMap<T> m,
LongLongUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
long |
mergeLong(T key,
long value,
LongLongUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
ObjectNavigableSet<T> |
navigableKeySet() |
ObjectSet<Object2LongMap.Entry<T>> |
object2LongEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
Object2LongMap.Entry<T> |
pollFirstEntry() |
T |
pollFirstKey()
A method to get and remove the first Key of a Map.
|
Object2LongMap.Entry<T> |
pollLastEntry() |
T |
pollLastKey()
A method to get and remove the last Key of a Map.
|
long |
put(T key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
putIfAbsent(T key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
long |
remOrDefault(T key,
long defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(T key,
long value)
Type Specific remove function to reduce boxing/unboxing
|
long |
replace(T key,
long value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
long oldValue,
long newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
long |
subFrom(T key,
long value)
A Helper method to subtract from primitive from each other.
|
Object2LongNavigableMap<T> |
subMap(T fromKey,
boolean fromInclusive,
T toKey,
boolean toInclusive) |
long |
supplyLongIfAbsent(T key,
LongSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
Object2LongNavigableMap<T> |
tailMap(T fromKey,
boolean inclusive) |
LongCollection |
values() |
addToAll, containsValue, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replaceLongs, replaceLongs, setDefaultReturnValueheadMap, subMap, synchronize, synchronize, tailMap, unmodifiableaddToAll, applyAsLong, builder, compute, computeIfAbsent, computeIfPresent, 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, setDefaultReturnValuepublic Object2LongRBTreeMap()
public Object2LongRBTreeMap(java.util.Comparator<T> comp)
comp - the function that decides how the tree is sorted, can be nullpublic Object2LongRBTreeMap(T[] 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 Object2LongRBTreeMap(T[] keys, java.lang.Long[] 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 Object2LongRBTreeMap(T[] 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 Object2LongRBTreeMap(T[] keys, long[] 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 Object2LongRBTreeMap(java.util.Map<? extends T,? extends java.lang.Long> map)
map - the values that should be present in the mappublic Object2LongRBTreeMap(java.util.Map<? extends T,? extends java.lang.Long> 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 Object2LongRBTreeMap(Object2LongMap<T> map)
map - the values that should be present in the mappublic Object2LongRBTreeMap(Object2LongMap<T> 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 long put(T key, long value)
Object2LongMapput in interface Object2LongMap<T>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public long putIfAbsent(T key, long value)
Object2LongMapputIfAbsent in interface Object2LongMap<T>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public long addTo(T key, long value)
Object2LongMapaddTo in interface Object2LongMap<T>key - the key that should be inserted,value - the value that should be inserted / addedpublic long subFrom(T key, long value)
Object2LongMapObject2LongMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Object2LongMap<T>key - that should be subtract fromvalue - that should be subtractpublic java.util.Comparator<T> comparator()
comparator in interface java.util.SortedMap<T,java.lang.Long>comparator in interface Object2LongSortedMap<T>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,java.lang.Long>containsKey in class AbstractObject2LongMap<T>public long getLong(T key)
Object2LongMapgetLong in interface Object2LongMap<T>key - the key that is searched forpublic long getOrDefault(T key, long defaultValue)
Object2LongMapgetOrDefault in interface Object2LongMap<T>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic T firstKey()
firstKey in interface java.util.SortedMap<T,java.lang.Long>public T pollFirstKey()
Object2LongSortedMappollFirstKey in interface Object2LongSortedMap<T>public T pollLastKey()
Object2LongSortedMappollLastKey in interface Object2LongSortedMap<T>public Object2LongMap.Entry<T> firstEntry()
firstEntry in interface java.util.NavigableMap<T,java.lang.Long>firstEntry in interface Object2LongNavigableMap<T>public Object2LongMap.Entry<T> lastEntry()
lastEntry in interface java.util.NavigableMap<T,java.lang.Long>lastEntry in interface Object2LongNavigableMap<T>public Object2LongMap.Entry<T> pollFirstEntry()
pollFirstEntry in interface java.util.NavigableMap<T,java.lang.Long>pollFirstEntry in interface Object2LongNavigableMap<T>public Object2LongMap.Entry<T> pollLastEntry()
pollLastEntry in interface java.util.NavigableMap<T,java.lang.Long>pollLastEntry in interface Object2LongNavigableMap<T>public long firstLongValue()
Object2LongSortedMapfirstLongValue in interface Object2LongSortedMap<T>public long lastLongValue()
Object2LongSortedMaplastLongValue in interface Object2LongSortedMap<T>public long rem(T key)
Object2LongMaprem in interface Object2LongMap<T>key - the element that should be removedpublic long remOrDefault(T key, long defaultValue)
Object2LongMapremOrDefault in interface Object2LongMap<T>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(T key, long value)
Object2LongMapremove in interface Object2LongMap<T>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean replace(T key, long oldValue, long newValue)
Object2LongMapreplace in interface Object2LongMap<T>replace in class AbstractObject2LongMap<T>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public long replace(T key, long value)
Object2LongMapreplace in interface Object2LongMap<T>replace in class AbstractObject2LongMap<T>key - the element that should be searched forvalue - the value to replace with.public long computeLong(T key, ObjectLongUnaryOperator<T> mappingFunction)
Object2LongMapcomputeLong in interface Object2LongMap<T>computeLong in class AbstractObject2LongMap<T>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic long computeLongIfAbsent(T key, ToLongFunction<T> mappingFunction)
Object2LongMapcomputeLongIfAbsent in interface Object2LongMap<T>computeLongIfAbsent in class AbstractObject2LongMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic long supplyLongIfAbsent(T key, LongSupplier valueProvider)
Object2LongMapsupplyLongIfAbsent in interface Object2LongMap<T>supplyLongIfAbsent in class AbstractObject2LongMap<T>key - the key that should be computedvalueProvider - the value if not presentpublic long computeLongIfPresent(T key, ObjectLongUnaryOperator<T> mappingFunction)
Object2LongMapcomputeLongIfPresent in interface Object2LongMap<T>computeLongIfPresent in class AbstractObject2LongMap<T>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic long mergeLong(T key, long value, LongLongUnaryOperator mappingFunction)
Object2LongMapmergeLong in interface Object2LongMap<T>mergeLong in class AbstractObject2LongMap<T>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 mergeAllLong(Object2LongMap<T> m, LongLongUnaryOperator mappingFunction)
Object2LongMapmergeAllLong in interface Object2LongMap<T>mergeAllLong in class AbstractObject2LongMap<T>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic void forEach(ObjectLongConsumer<T> action)
Object2LongMapforEach in interface Object2LongMap<T>forEach in class AbstractObject2LongMap<T>action - processor of the values that are iterator overpublic int size()
public void clear()
public Object2LongRBTreeMap<T> copy()
Object2LongMapcopy in interface Object2LongMap<T>copy in interface Object2LongNavigableMap<T>copy in interface Object2LongSortedMap<T>copy in class AbstractObject2LongMap<T>public ObjectNavigableSet<T> keySet()
keySet in interface java.util.Map<T,java.lang.Long>keySet in interface java.util.SortedMap<T,java.lang.Long>keySet in interface Object2LongMap<T>keySet in interface Object2LongNavigableMap<T>keySet in interface Object2LongSortedMap<T>keySet in class AbstractObject2LongMap<T>public ObjectSet<Object2LongMap.Entry<T>> object2LongEntrySet()
Object2LongMapobject2LongEntrySet in interface Object2LongMap<T>public LongCollection values()
values in interface java.util.Map<T,java.lang.Long>values in interface java.util.SortedMap<T,java.lang.Long>values in interface Object2LongMap<T>values in interface Object2LongSortedMap<T>values in class AbstractObject2LongMap<T>public ObjectNavigableSet<T> navigableKeySet()
navigableKeySet in interface java.util.NavigableMap<T,java.lang.Long>navigableKeySet in interface Object2LongNavigableMap<T>public Object2LongNavigableMap<T> descendingMap()
descendingMap in interface java.util.NavigableMap<T,java.lang.Long>descendingMap in interface Object2LongNavigableMap<T>public ObjectNavigableSet<T> descendingKeySet()
descendingKeySet in interface java.util.NavigableMap<T,java.lang.Long>descendingKeySet in interface Object2LongNavigableMap<T>public Object2LongNavigableMap<T> subMap(T fromKey, boolean fromInclusive, T toKey, boolean toInclusive)
subMap in interface java.util.NavigableMap<T,java.lang.Long>subMap in interface Object2LongNavigableMap<T>public Object2LongNavigableMap<T> headMap(T toKey, boolean inclusive)
headMap in interface java.util.NavigableMap<T,java.lang.Long>headMap in interface Object2LongNavigableMap<T>public Object2LongNavigableMap<T> tailMap(T fromKey, boolean inclusive)
tailMap in interface java.util.NavigableMap<T,java.lang.Long>tailMap in interface Object2LongNavigableMap<T>public T lowerKey(T e)
lowerKey in interface java.util.NavigableMap<T,java.lang.Long>public T floorKey(T e)
floorKey in interface java.util.NavigableMap<T,java.lang.Long>public T higherKey(T e)
higherKey in interface java.util.NavigableMap<T,java.lang.Long>public T ceilingKey(T e)
ceilingKey in interface java.util.NavigableMap<T,java.lang.Long>public Object2LongMap.Entry<T> lowerEntry(T key)
lowerEntry in interface java.util.NavigableMap<T,java.lang.Long>lowerEntry in interface Object2LongNavigableMap<T>public Object2LongMap.Entry<T> higherEntry(T key)
higherEntry in interface java.util.NavigableMap<T,java.lang.Long>higherEntry in interface Object2LongNavigableMap<T>public Object2LongMap.Entry<T> floorEntry(T key)
floorEntry in interface java.util.NavigableMap<T,java.lang.Long>floorEntry in interface Object2LongNavigableMap<T>public Object2LongMap.Entry<T> ceilingEntry(T key)
ceilingEntry in interface java.util.NavigableMap<T,java.lang.Long>ceilingEntry in interface Object2LongNavigableMap<T>