T - the type of elements maintained by this Collectionpublic class Object2LongArrayMap<T> extends AbstractObject2LongMap<T> implements Object2LongSortedMap<T>
AbstractObject2LongMap.BasicEntry<T>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2LongSortedMap.FastSortedSet<T>Object2LongMap.Entry<T>, Object2LongMap.FastEntrySet<T>| Constructor and Description |
|---|
Object2LongArrayMap()
Default Constructor
|
Object2LongArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Object2LongArrayMap(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.
|
Object2LongArrayMap(Object2LongMap<T> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2LongArrayMap(T[] keys,
long[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2LongArrayMap(T[] keys,
java.lang.Long[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Object2LongArrayMap(T[] keys,
long[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Object2LongArrayMap(T[] keys,
java.lang.Long[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
| Modifier and Type | Method and Description |
|---|---|
long |
addTo(T key,
long value)
A Helper method to add a primitives together.
|
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,
Object2LongFunction<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) |
boolean |
containsValue(long value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
T |
firstKey() |
long |
firstLongValue()
A method to get the first Value of a Map.
|
void |
forEach(ObjectLongConsumer<T> action)
Type Specific forEach method to reduce boxing/unboxing
|
long |
getAndMoveToFirst(T key)
A Specific get method that allows to move teh given key/value int the first index.
|
long |
getAndMoveToLast(T key)
A Specific get method that allows to move teh given key/value int the last index.
|
long |
getLong(T key)
A Type Specific get method to reduce boxing/unboxing
|
long |
getOrDefault(java.lang.Object key,
long defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Object2LongSortedMap<T> |
headMap(T toKey) |
ObjectSet<T> |
keySet() |
T |
lastKey() |
long |
lastLongValue()
A method to get the last Value of a Map.
|
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
|
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.
|
ObjectSortedSet<Object2LongMap.Entry<T>> |
object2LongEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
T |
pollFirstKey()
A method to get and remove the first Key of a Map.
|
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 |
putAndMoveToFirst(T key,
long value)
A customized put method that allows you to insert into the first index.
|
long |
putAndMoveToLast(T key,
long value)
A customized put method that allows you to insert into the last index.
|
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.
|
java.lang.Long |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
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() |
Object2LongSortedMap<T> |
subMap(T fromKey,
T toKey) |
Object2LongSortedMap<T> |
tailMap(T fromKey) |
LongCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceLongs, replaceLongs, setDefaultReturnValueaddToAll, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceLongs, replaceLongs, setDefaultReturnValueapplyAsLongpublic Object2LongArrayMap()
public Object2LongArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Object2LongArrayMap(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 lengthpublic Object2LongArrayMap(T[] keys, java.lang.Long[] values, int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lengthpublic Object2LongArrayMap(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 Object2LongArrayMap(T[] keys, long[] values, int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Object2LongArrayMap(java.util.Map<? extends T,? extends java.lang.Long> map)
map - the values that should be present in the mappublic Object2LongArrayMap(Object2LongMap<T> map)
map - the values that should be present in the mappublic 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 putAndMoveToFirst(T key, long value)
Object2LongSortedMapputAndMoveToFirst in interface Object2LongSortedMap<T>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public long putAndMoveToLast(T key, long value)
Object2LongSortedMapputAndMoveToLast in interface Object2LongSortedMap<T>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(T key)
Object2LongSortedMapmoveToFirst in interface Object2LongSortedMap<T>key - that should be moved to the first indexpublic boolean moveToLast(T key)
Object2LongSortedMapmoveToLast in interface Object2LongSortedMap<T>key - that should be moved to the first lastpublic boolean containsValue(long value)
Object2LongMapcontainsValue in interface Object2LongMap<T>containsValue in class AbstractObject2LongMap<T>value - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,java.lang.Long>containsKey in class AbstractObject2LongMap<T>public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<T,java.lang.Long>containsValue in interface Object2LongMap<T>containsValue in class java.util.AbstractMap<T,java.lang.Long>value - that is searched for.Map.containsValue(Object)public long getLong(T key)
Object2LongMapgetLong in interface Object2LongFunction<T>getLong in interface Object2LongMap<T>key - the key that is searched forpublic long getOrDefault(java.lang.Object 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 long getAndMoveToFirst(T key)
Object2LongSortedMapgetAndMoveToFirst in interface Object2LongSortedMap<T>key - that is searched forpublic long getAndMoveToLast(T key)
Object2LongSortedMapgetAndMoveToLast in interface Object2LongSortedMap<T>key - that is searched forpublic T firstKey()
firstKey in interface java.util.SortedMap<T,java.lang.Long>public long firstLongValue()
Object2LongSortedMapfirstLongValue in interface Object2LongSortedMap<T>public long lastLongValue()
Object2LongSortedMaplastLongValue in interface Object2LongSortedMap<T>public T pollFirstKey()
Object2LongSortedMappollFirstKey in interface Object2LongSortedMap<T>public T pollLastKey()
Object2LongSortedMappollLastKey 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 java.lang.Long remove(java.lang.Object key)
remove in interface java.util.Map<T,java.lang.Long>remove in interface Object2LongMap<T>remove in class java.util.AbstractMap<T,java.lang.Long>key - the element that should be removedMap.remove(Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<T,java.lang.Long>remove in interface Object2LongMap<T>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(ObjectLongConsumer<T> action)
Object2LongMapforEach in interface Object2LongMap<T>forEach in class AbstractObject2LongMap<T>action - processor of the values that are iterator overpublic ObjectSet<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 Object2LongSortedMap<T>keySet in class AbstractObject2LongMap<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 ObjectSortedSet<Object2LongMap.Entry<T>> object2LongEntrySet()
Object2LongMapobject2LongEntrySet in interface Object2LongMap<T>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, Object2LongFunction<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 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 int size()
public void clear()
public java.util.Comparator<T> comparator()
comparator in interface java.util.SortedMap<T,java.lang.Long>comparator in interface Object2LongSortedMap<T>public Object2LongSortedMap<T> subMap(T fromKey, T toKey)
subMap in interface java.util.SortedMap<T,java.lang.Long>subMap in interface Object2LongSortedMap<T>public Object2LongSortedMap<T> headMap(T toKey)
headMap in interface java.util.SortedMap<T,java.lang.Long>headMap in interface Object2LongSortedMap<T>public Object2LongSortedMap<T> tailMap(T fromKey)
tailMap in interface java.util.SortedMap<T,java.lang.Long>tailMap in interface Object2LongSortedMap<T>