V - the keyType of elements maintained by this Collectionpublic static class Short2ObjectMaps.SingletonMap<V> extends AbstractShort2ObjectMap<V>
AbstractShort2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Short2ObjectMap.BuilderCache<V>, Short2ObjectMap.Entry<V>, Short2ObjectMap.FastEntrySet<V>, Short2ObjectMap.MapBuilder| Modifier and Type | Method and Description |
|---|---|
V |
compute(short key,
ShortObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(short key,
ShortFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(short key,
ShortObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
Short2ObjectMaps.SingletonMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
V |
get(short key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(short key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ShortSet |
keySet() |
V |
merge(short key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Short2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
V |
put(short key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putIfAbsent(short key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(short key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(short key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
removeOrDefault(short key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
ObjectSet<Short2ObjectMap.Entry<V>> |
short2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
V |
supplyIfAbsent(short 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, setDefaultReturnValueapply, builder, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, merge, put, put, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic V put(short key, V value)
Short2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(short key, V value)
Short2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V remove(short key)
Short2ObjectMapkey - the element that should be removedpublic V removeOrDefault(short key, V defaultValue)
Short2ObjectMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(short key,
V value)
Short2ObjectMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public V get(short key)
Short2ObjectMapkey - the key that is searched forpublic V getOrDefault(short key, V defaultValue)
Short2ObjectMapgetOrDefault in interface Short2ObjectMap<V>getOrDefault in class AbstractShort2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic V compute(short key, ShortObjectUnaryOperator<V> mappingFunction)
Short2ObjectMapcompute in interface Short2ObjectMap<V>compute in class AbstractShort2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(short key, ShortFunction<V> mappingFunction)
Short2ObjectMapcomputeIfAbsent in interface Short2ObjectMap<V>computeIfAbsent in class AbstractShort2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V computeIfPresent(short key, ShortObjectUnaryOperator<V> mappingFunction)
Short2ObjectMapcomputeIfPresent in interface Short2ObjectMap<V>computeIfPresent in class AbstractShort2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V supplyIfAbsent(short key, ObjectSupplier<V> valueProvider)
Short2ObjectMapsupplyIfAbsent in interface Short2ObjectMap<V>supplyIfAbsent in class AbstractShort2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V merge(short key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Short2ObjectMapmerge in interface Short2ObjectMap<V>merge in class AbstractShort2ObjectMap<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(Short2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Short2ObjectMapmergeAll in interface Short2ObjectMap<V>mergeAll in class AbstractShort2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic Short2ObjectMaps.SingletonMap<V> copy()
Short2ObjectMapcopy in interface Short2ObjectMap<V>copy in class AbstractShort2ObjectMap<V>public ShortSet keySet()
keySet in interface java.util.Map<java.lang.Short,V>keySet in interface Short2ObjectMap<V>keySet in class AbstractShort2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Short,V>values in interface Short2ObjectMap<V>values in class AbstractShort2ObjectMap<V>public ObjectSet<Short2ObjectMap.Entry<V>> short2ObjectEntrySet()
Short2ObjectMap