V - the type of elements maintained by this Collectionpublic static class Int2ObjectMaps.SingletonMap<V> extends AbstractInt2ObjectMap<V>
AbstractInt2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2ObjectMap.BuilderCache<V>, Int2ObjectMap.Entry<V>, Int2ObjectMap.FastEntrySet<V>, Int2ObjectMap.MapBuilder| Modifier and Type | Method and Description |
|---|---|
V |
compute(int key,
IntObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(int key,
Int2ObjectFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(int key,
IntObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
Int2ObjectMaps.SingletonMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
V |
get(int key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(int key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<Int2ObjectMap.Entry<V>> |
int2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntSet |
keySet() |
V |
merge(int key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Int2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
V |
put(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putIfAbsent(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
removeOrDefault(int key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
supplyIfAbsent(int 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, replaceObjects, replaceObjects, setDefaultReturnValuebuilder, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, merge, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiableapplypublic V put(int key, V value)
Int2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(int key, V value)
Int2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V remove(int key)
Int2ObjectMapkey - the element that should be removedpublic V removeOrDefault(int key, V defaultValue)
Int2ObjectMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(int key,
V value)
Int2ObjectMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public V get(int key)
Int2ObjectMapkey - the key that is searched forpublic V getOrDefault(int key, V defaultValue)
Int2ObjectMapgetOrDefault in interface Int2ObjectMap<V>getOrDefault in class AbstractInt2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic V compute(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcompute in interface Int2ObjectMap<V>compute in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(int key, Int2ObjectFunction<V> mappingFunction)
Int2ObjectMapcomputeIfAbsent in interface Int2ObjectMap<V>computeIfAbsent in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V computeIfPresent(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcomputeIfPresent in interface Int2ObjectMap<V>computeIfPresent in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V supplyIfAbsent(int key, ObjectSupplier<V> valueProvider)
Int2ObjectMapsupplyIfAbsent in interface Int2ObjectMap<V>supplyIfAbsent in class AbstractInt2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V merge(int key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmerge in interface Int2ObjectMap<V>merge in class AbstractInt2ObjectMap<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(Int2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmergeAll in interface Int2ObjectMap<V>mergeAll in class AbstractInt2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic Int2ObjectMaps.SingletonMap<V> copy()
Int2ObjectMapcopy in interface Int2ObjectMap<V>copy in class AbstractInt2ObjectMap<V>public IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,V>keySet in interface Int2ObjectMap<V>keySet in class AbstractInt2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Integer,V>values in interface Int2ObjectMap<V>values in class AbstractInt2ObjectMap<V>public ObjectSet<Int2ObjectMap.Entry<V>> int2ObjectEntrySet()
Int2ObjectMap