public static class Short2IntMaps.SingletonMap extends AbstractShort2IntMap
AbstractShort2IntMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Short2IntMap.BuilderCache, Short2IntMap.Entry, Short2IntMap.FastEntrySet, Short2IntMap.MapBuilder| Modifier and Type | Method and Description |
|---|---|
int |
addTo(short key,
int value)
A Helper method to add a primitives together.
|
int |
computeInt(short key,
ShortIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfAbsent(short key,
Short2IntFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfPresent(short key,
ShortIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
Short2IntMaps.SingletonMap |
copy()
A Function that does a shallow clone of the Map itself.
|
int |
get(short key)
A Type Specific get method to reduce boxing/unboxing
|
int |
getOrDefault(short key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ShortSet |
keySet() |
void |
mergeAllInt(Short2IntMap m,
IntIntUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
int |
mergeInt(short key,
int value,
IntIntUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
int |
put(short key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
putIfAbsent(short key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
remove(short key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(short key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
int |
removeOrDefault(short key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
ObjectSet<Short2IntMap.Entry> |
short2IntEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
int |
subFrom(short key,
int value)
A Helper method to subtract from primitive from each other.
|
int |
supplyIntIfAbsent(short key,
IntSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
IntCollection |
values() |
addToAll, containsKey, containsValue, entrySet, equals, forEach, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replace, replace, replaceInts, replaceInts, setDefaultReturnValueclear, containsKey, containsValue, isEmpty, size, toStringbuilder, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, merge, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic int put(short key,
int value)
Short2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public int putIfAbsent(short key,
int value)
Short2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public int addTo(short key,
int value)
Short2IntMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic int subFrom(short key,
int value)
Short2IntMapShort2IntMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedkey - that should be subtract fromvalue - that should be subtractpublic int remove(short key)
Short2IntMapkey - the element that should be removedpublic int removeOrDefault(short key,
int defaultValue)
Short2IntMapkey - 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,
int value)
Short2IntMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public int get(short key)
Short2IntMapkey - the key that is searched forpublic int getOrDefault(short key,
int defaultValue)
Short2IntMapgetOrDefault in interface Short2IntMapgetOrDefault in class AbstractShort2IntMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic int computeInt(short key,
ShortIntUnaryOperator mappingFunction)
Short2IntMapcomputeInt in interface Short2IntMapcomputeInt in class AbstractShort2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic int computeIntIfAbsent(short key,
Short2IntFunction mappingFunction)
Short2IntMapcomputeIntIfAbsent in interface Short2IntMapcomputeIntIfAbsent in class AbstractShort2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic int computeIntIfPresent(short key,
ShortIntUnaryOperator mappingFunction)
Short2IntMapcomputeIntIfPresent in interface Short2IntMapcomputeIntIfPresent in class AbstractShort2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic int supplyIntIfAbsent(short key,
IntSupplier valueProvider)
Short2IntMapsupplyIntIfAbsent in interface Short2IntMapsupplyIntIfAbsent in class AbstractShort2IntMapkey - the key that should be computedvalueProvider - the value if not presentpublic int mergeInt(short key,
int value,
IntIntUnaryOperator mappingFunction)
Short2IntMapmergeInt in interface Short2IntMapmergeInt in class AbstractShort2IntMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllInt(Short2IntMap m, IntIntUnaryOperator mappingFunction)
Short2IntMapmergeAllInt in interface Short2IntMapmergeAllInt in class AbstractShort2IntMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic Short2IntMaps.SingletonMap copy()
Short2IntMapcopy in interface Short2IntMapcopy in class AbstractShort2IntMappublic ShortSet keySet()
keySet in interface java.util.Map<java.lang.Short,java.lang.Integer>keySet in interface Short2IntMapkeySet in class AbstractShort2IntMappublic IntCollection values()
values in interface java.util.Map<java.lang.Short,java.lang.Integer>values in interface Short2IntMapvalues in class AbstractShort2IntMappublic ObjectSet<Short2IntMap.Entry> short2IntEntrySet()
Short2IntMap