V - the keyType of elements maintained by this Collectionpublic static class Long2ObjectMaps.UnmodifyableMap<V> extends AbstractLong2ObjectMap<V> implements Long2ObjectMap<V>
AbstractLong2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ObjectMap.BuilderCache<V>, Long2ObjectMap.Entry<V>, Long2ObjectMap.FastEntrySet<V>, Long2ObjectMap.MapBuilder| 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
|
Long2ObjectMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
V |
get(long key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(long key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
LongSet |
keySet() |
ObjectSet<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.
|
V |
put(long key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
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 |
removeOrDefault(long key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
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
|
V |
supplyIfAbsent(long key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ObjectCollection<V> |
values() |
containsKey, containsValue, entrySet, equals, forEach, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replace, replace, setDefaultReturnValueapply, builder, compute, computeIfAbsent, computeIfPresent, containsKey, containsKey, entrySet, forEach, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, remove, remove, replace, replace, replace, replace, replaceAll, setDefaultReturnValue, synchronize, synchronize, unmodifiablepublic 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 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 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 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 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 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 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 void replaceObjects(LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapreplaceObjects in interface Long2ObjectMap<V>replaceObjects in class AbstractLong2ObjectMap<V>mappingFunction - operation to replace all valuespublic void replaceObjects(Long2ObjectMap<V> m)
Long2ObjectMapreplaceObjects in interface Long2ObjectMap<V>replaceObjects in class AbstractLong2ObjectMap<V>m - elements that should be replaced.public Long2ObjectMap<V> copy()
Long2ObjectMapcopy in interface Long2ObjectMap<V>copy in class AbstractLong2ObjectMap<V>public void clear()
public LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,V>keySet in interface Long2ObjectMap<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 ObjectSet<Long2ObjectMap.Entry<V>> long2ObjectEntrySet()
Long2ObjectMaplong2ObjectEntrySet in interface Long2ObjectMap<V>