public static class Long2ShortMaps.SingletonMap extends AbstractLong2ShortMap
AbstractLong2ShortMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ShortMap.BuilderCache, Long2ShortMap.Entry, Long2ShortMap.FastEntrySet, Long2ShortMap.MapBuilder| Modifier and Type | Method and Description |
|---|---|
short |
addTo(long key,
short value)
A Helper method to add a primitives together.
|
short |
computeShort(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
short |
computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
Long2ShortMaps.SingletonMap |
copy()
A Function that does a shallow clone of the Map itself.
|
short |
get(long key)
A Type Specific get method to reduce boxing/unboxing
|
short |
getOrDefault(long key,
short defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
LongSet |
keySet() |
ObjectSet<Long2ShortMap.Entry> |
long2ShortEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
mergeAllShort(Long2ShortMap m,
ShortShortUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
short |
mergeShort(long key,
short value,
ShortShortUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
short |
put(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
putIfAbsent(long key,
short value)
Type Specific method to reduce boxing/unboxing of values
|
short |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long key,
short value)
Type Specific remove function to reduce boxing/unboxing
|
short |
removeOrDefault(long key,
short defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
short |
subFrom(long key,
short value)
A Helper method to subtract from primitive from each other.
|
short |
supplyShortIfAbsent(long key,
ShortSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ShortCollection |
values() |
addToAll, containsKey, containsValue, entrySet, equals, forEach, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replace, replace, replaceShorts, replaceShorts, setDefaultReturnValueclear, containsKey, containsValue, isEmpty, size, toStringapplyAsShort, builder, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, merge, put, put, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic short put(long key,
short value)
Long2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public short putIfAbsent(long key,
short value)
Long2ShortMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public short addTo(long key,
short value)
Long2ShortMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic short subFrom(long key,
short value)
Long2ShortMapLong2ShortMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedkey - that should be subtract fromvalue - that should be subtractpublic short remove(long key)
Long2ShortMapkey - the element that should be removedpublic short removeOrDefault(long key,
short defaultValue)
Long2ShortMapkey - 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,
short value)
Long2ShortMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public short get(long key)
Long2ShortMapkey - the key that is searched forpublic short getOrDefault(long key,
short defaultValue)
Long2ShortMapgetOrDefault in interface Long2ShortMapgetOrDefault in class AbstractLong2ShortMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic short computeShort(long key,
LongShortUnaryOperator mappingFunction)
Long2ShortMapcomputeShort in interface Long2ShortMapcomputeShort in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic short computeShortIfAbsent(long key,
Long2ShortFunction mappingFunction)
Long2ShortMapcomputeShortIfAbsent in interface Long2ShortMapcomputeShortIfAbsent in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic short computeShortIfPresent(long key,
LongShortUnaryOperator mappingFunction)
Long2ShortMapcomputeShortIfPresent in interface Long2ShortMapcomputeShortIfPresent in class AbstractLong2ShortMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic short supplyShortIfAbsent(long key,
ShortSupplier valueProvider)
Long2ShortMapsupplyShortIfAbsent in interface Long2ShortMapsupplyShortIfAbsent in class AbstractLong2ShortMapkey - the key that should be computedvalueProvider - the value if not presentpublic short mergeShort(long key,
short value,
ShortShortUnaryOperator mappingFunction)
Long2ShortMapmergeShort in interface Long2ShortMapmergeShort in class AbstractLong2ShortMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllShort(Long2ShortMap m, ShortShortUnaryOperator mappingFunction)
Long2ShortMapmergeAllShort in interface Long2ShortMapmergeAllShort in class AbstractLong2ShortMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic Long2ShortMaps.SingletonMap copy()
Long2ShortMapcopy in interface Long2ShortMapcopy in class AbstractLong2ShortMappublic LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Short>keySet in interface Long2ShortMapkeySet in class AbstractLong2ShortMappublic ShortCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Short>values in interface Long2ShortMapvalues in class AbstractLong2ShortMappublic ObjectSet<Long2ShortMap.Entry> long2ShortEntrySet()
Long2ShortMap