V - the keyType of elements maintained by this Collectionpublic abstract class AbstractLong2ObjectMap<V> extends java.util.AbstractMap<java.lang.Long,V> implements Long2ObjectMap<V>
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractLong2ObjectMap.BasicEntry<V>
A Simple Type Specific Entry class to reduce boxing/unboxing
|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ObjectMap.BuilderCache<V>, Long2ObjectMap.Entry<V>, Long2ObjectMap.FastEntrySet<V>, Long2ObjectMap.MapBuilder| Constructor and Description |
|---|
AbstractLong2ObjectMap() |
| Modifier and Type | Method and Description |
|---|---|
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 |
containsValue(java.lang.Object value) |
Long2ObjectMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<java.lang.Long,V>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
void |
forEach(LongObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(java.lang.Object key) |
V |
getDefaultReturnValue()
Method to see what the default return value is.
|
V |
getOrDefault(long key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
V |
getOrDefault(java.lang.Object key,
V defaultValue) |
int |
hashCode() |
LongSet |
keySet() |
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.
|
V |
put(java.lang.Long key,
V value)
Deprecated.
|
void |
putAll(long[] keys,
V[] values,
int offset,
int size)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(java.lang.Long[] keys,
V[] values,
int offset,
int size)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(Long2ObjectMap<V> m)
Type Specific function for the bull putting of values
|
void |
putAll(java.util.Map<? extends java.lang.Long,? extends V> m) |
void |
putAllIfAbsent(Long2ObjectMap<V> m)
Type-Specific bulk put method put elements into the map if not present.
|
V |
remove(java.lang.Object key) |
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
|
void |
replaceObjects(Long2ObjectMap<V> m)
Type-Specific bulk replace method.
|
void |
replaceObjects(LongObjectUnaryOperator<V> mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
AbstractLong2ObjectMap<V> |
setDefaultReturnValue(V v)
Method to define the default return value if a requested key isn't present
|
V |
supplyIfAbsent(long key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ObjectCollection<V> |
values() |
apply, builder, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, get, long2ObjectEntrySet, merge, put, put, put, putAll, putAll, putIfAbsent, putIfAbsent, remove, remove, remove, removeOrDefault, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic V getDefaultReturnValue()
Long2ObjectMapgetDefaultReturnValue in interface Long2ObjectMap<V>public AbstractLong2ObjectMap<V> setDefaultReturnValue(V v)
Long2ObjectMapsetDefaultReturnValue in interface Long2ObjectMap<V>v - value that should be the default return valuepublic Long2ObjectMap<V> copy()
Long2ObjectMapcopy in interface Long2ObjectMap<V>@Deprecated public V put(java.lang.Long key, V value)
put in interface java.util.Map<java.lang.Long,V>put in interface Long2ObjectMap<V>put in class java.util.AbstractMap<java.lang.Long,V>public void putAll(Long2ObjectMap<V> m)
Long2ObjectMapputAll in interface Long2ObjectMap<V>m - the elements that should be insertedpublic void putAll(java.util.Map<? extends java.lang.Long,? extends V> m)
public void putAll(long[] keys,
V[] values,
int offset,
int size)
Long2ObjectMapputAll in interface Long2ObjectMap<V>keys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedMap.putAll(Map)public void putAll(java.lang.Long[] keys,
V[] values,
int offset,
int size)
Long2ObjectMapputAll in interface Long2ObjectMap<V>keys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedMap.putAll(Map)public void putAllIfAbsent(Long2ObjectMap<V> m)
Long2ObjectMapputAllIfAbsent in interface Long2ObjectMap<V>m - elements that should be added if not present.public boolean containsKey(long key)
Long2ObjectMapcontainsKey in interface Long2ObjectMap<V>key - element that is searched forpublic boolean containsValue(java.lang.Object value)
public boolean replace(long key,
V oldValue,
V newValue)
Long2ObjectMapreplace in interface Long2ObjectMap<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>key - the element that should be searched forvalue - the value to replace with.public void replaceObjects(Long2ObjectMap<V> m)
Long2ObjectMapreplaceObjects in interface Long2ObjectMap<V>m - elements that should be replaced.public void replaceObjects(LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapreplaceObjects in interface Long2ObjectMap<V>mappingFunction - operation to replace all valuespublic V compute(long key, LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapcompute in interface Long2ObjectMap<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>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>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(long key, LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapcomputeIfPresent in interface Long2ObjectMap<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>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>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic V get(java.lang.Object key)
get in interface java.util.Map<java.lang.Long,V>get in interface Long2ObjectMap<V>get in class java.util.AbstractMap<java.lang.Long,V>public V getOrDefault(java.lang.Object key, V defaultValue)
getOrDefault in interface java.util.Map<java.lang.Long,V>getOrDefault in interface Long2ObjectMap<V>public V getOrDefault(long key, V defaultValue)
Long2ObjectMapgetOrDefault in interface Long2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Long,V>remove in interface Long2ObjectMap<V>remove in class java.util.AbstractMap<java.lang.Long,V>key - the element that should be removedMap.remove(Object)public void forEach(LongObjectConsumer<V> action)
Long2ObjectMapforEach in interface Long2ObjectMap<V>action - processor of the values that are iterator overpublic LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,V>keySet in interface Long2ObjectMap<V>keySet in class java.util.AbstractMap<java.lang.Long,V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Long,V>values in interface Long2ObjectMap<V>values in class java.util.AbstractMap<java.lang.Long,V>public ObjectSet<java.util.Map.Entry<java.lang.Long,V>> entrySet()
entrySet in interface java.util.Map<java.lang.Long,V>entrySet in interface Long2ObjectMap<V>entrySet in class java.util.AbstractMap<java.lang.Long,V>public boolean equals(java.lang.Object o)