V - the keyType of elements maintained by this Collectionpublic class Long2ObjectArrayMap<V> extends AbstractLong2ObjectMap<V> implements Long2ObjectOrderedMap<V>
AbstractLong2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ObjectOrderedMap.FastOrderedSet<V>Long2ObjectMap.BuilderCache<V>, Long2ObjectMap.Entry<V>, Long2ObjectMap.FastEntrySet<V>, Long2ObjectMap.MapBuilder| Constructor and Description |
|---|
Long2ObjectArrayMap()
Default Constructor
|
Long2ObjectArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Long2ObjectArrayMap(long[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2ObjectArrayMap(java.lang.Long[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2ObjectArrayMap(long[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Long2ObjectArrayMap(java.lang.Long[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Long2ObjectArrayMap(Long2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2ObjectArrayMap(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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
V |
compute(long key,
LongObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(long key,
LongFunction<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
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
Long2ObjectArrayMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
long |
firstLongKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
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
|
V |
getAndMoveToFirst(long key)
A Specific get method that allows to move teh given key/value int the first index.
|
V |
getAndMoveToLast(long key)
A Specific get method that allows to move teh given key/value int the last index.
|
V |
getOrDefault(long key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
LongOrderedSet |
keySet() |
long |
lastLongKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
ObjectOrderedSet<Long2ObjectMap.Entry<V>> |
long2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
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.
|
boolean |
moveToFirst(long key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(long key)
A specific move method to move a given key/value to the last index.
|
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
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 |
putAndMoveToFirst(long key,
V value)
A customized put method that allows you to insert into the first index.
|
V |
putAndMoveToLast(long key,
V value)
A customized put method that allows you to insert into the last index.
|
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 |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
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
|
int |
size() |
V |
supplyIfAbsent(long key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ObjectCollection<V> |
values() |
entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuesynchronize, synchronize, unmodifiableapply, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic Long2ObjectArrayMap()
public Long2ObjectArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Long2ObjectArrayMap(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 lengthpublic Long2ObjectArrayMap(java.lang.Long[] keys,
V[] 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 Long2ObjectArrayMap(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 Long2ObjectArrayMap(long[] keys,
V[] 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 Long2ObjectArrayMap(java.util.Map<? extends java.lang.Long,? extends V> map)
map - the values that should be present in the mappublic Long2ObjectArrayMap(Long2ObjectMap<V> map)
map - the values that should be present in the mappublic 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 V putAndMoveToFirst(long key, V value)
Long2ObjectOrderedMapputAndMoveToFirst in interface Long2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(long key, V value)
Long2ObjectOrderedMapputAndMoveToLast in interface Long2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(long key)
Long2ObjectOrderedMapmoveToFirst in interface Long2ObjectOrderedMap<V>key - that should be moved to the first indexpublic boolean moveToLast(long key)
Long2ObjectOrderedMapmoveToLast in interface Long2ObjectOrderedMap<V>key - that should be moved to the first lastpublic boolean containsKey(long key)
Long2ObjectMapcontainsKey in interface Long2ObjectMap<V>containsKey in class AbstractLong2ObjectMap<V>key - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Long,V>containsKey in interface Long2ObjectMap<V>containsKey in class java.util.AbstractMap<java.lang.Long,V>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Long,V>containsValue in class AbstractLong2ObjectMap<V>public V get(long key)
Long2ObjectMapget 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 V getAndMoveToFirst(long key)
Long2ObjectOrderedMapgetAndMoveToFirst in interface Long2ObjectOrderedMap<V>key - that is searched forpublic V getAndMoveToLast(long key)
Long2ObjectOrderedMapgetAndMoveToLast in interface Long2ObjectOrderedMap<V>key - that is searched forpublic long firstLongKey()
Long2ObjectOrderedMapfirstLongKey in interface Long2ObjectOrderedMap<V>public long lastLongKey()
Long2ObjectOrderedMaplastLongKey in interface Long2ObjectOrderedMap<V>public V firstValue()
Long2ObjectOrderedMapfirstValue in interface Long2ObjectOrderedMap<V>public V lastValue()
Long2ObjectOrderedMaplastValue in interface Long2ObjectOrderedMap<V>public long pollFirstLongKey()
Long2ObjectOrderedMappollFirstLongKey in interface Long2ObjectOrderedMap<V>public long pollLastLongKey()
Long2ObjectOrderedMappollLastLongKey in interface Long2ObjectOrderedMap<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 V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Long,V>remove in interface Long2ObjectMap<V>remove in class AbstractLong2ObjectMap<V>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<java.lang.Long,V>remove in interface Long2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(LongObjectConsumer<V> action)
Long2ObjectMapforEach in interface Long2ObjectMap<V>forEach in class AbstractLong2ObjectMap<V>action - processor of the values that are iterator overpublic LongOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Long,V>keySet in interface Long2ObjectMap<V>keySet in interface Long2ObjectOrderedMap<V>keySet in class AbstractLong2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Long,V>values in interface Long2ObjectMap<V>values in class AbstractLong2ObjectMap<V>public ObjectOrderedSet<Long2ObjectMap.Entry<V>> long2ObjectEntrySet()
Long2ObjectMaplong2ObjectEntrySet in interface Long2ObjectMap<V>long2ObjectEntrySet in interface Long2ObjectOrderedMap<V>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, LongFunction<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 int size()
public void clear()
public Long2ObjectArrayMap<V> copy()
Long2ObjectMapcopy in interface Long2ObjectMap<V>copy in interface Long2ObjectOrderedMap<V>copy in class AbstractLong2ObjectMap<V>