public static class Int2IntMaps.EmptyMap extends AbstractInt2IntMap
AbstractInt2IntMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2IntMap.BuilderCache, Int2IntMap.Entry, Int2IntMap.FastEntrySet, Int2IntMap.MapBuilder| Constructor and Description |
|---|
EmptyMap() |
| Modifier and Type | Method and Description |
|---|---|
int |
addTo(int key,
int value)
A Helper method to add a primitives together.
|
int |
computeInt(int key,
IntIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfAbsent(int key,
IntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfPresent(int key,
IntIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
Int2IntMaps.EmptyMap |
copy()
A Function that does a shallow clone of the Map itself.
|
int |
get(int key)
A Type Specific get method to reduce boxing/unboxing
|
int |
getOrDefault(int key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<Int2IntMap.Entry> |
int2IntEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntSet |
keySet() |
void |
mergeAllInt(Int2IntMap m,
IntIntUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
int |
mergeInt(int key,
int value,
IntIntUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
int |
put(int key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
putIfAbsent(int key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
int |
removeOrDefault(int key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
int |
subFrom(int key,
int value)
A Helper method to subtract from primitive from each other.
|
int |
supplyIntIfAbsent(int 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, toStringapplyAsInt, builder, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, merge, put, put, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiableandThen, compose, identitypublic int put(int key,
int value)
Int2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public int putIfAbsent(int key,
int value)
Int2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public int addTo(int key,
int value)
Int2IntMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic int subFrom(int key,
int value)
Int2IntMapInt2IntMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedkey - that should be subtract fromvalue - that should be subtractpublic int remove(int key)
Int2IntMapkey - the element that should be removedpublic int removeOrDefault(int key,
int defaultValue)
Int2IntMapkey - 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,
int value)
Int2IntMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public int get(int key)
Int2IntMapkey - the key that is searched forpublic int getOrDefault(int key,
int defaultValue)
Int2IntMapgetOrDefault in interface Int2IntMapgetOrDefault in class AbstractInt2IntMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic int computeInt(int key,
IntIntUnaryOperator mappingFunction)
Int2IntMapcomputeInt in interface Int2IntMapcomputeInt in class AbstractInt2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic int computeIntIfAbsent(int key,
IntUnaryOperator mappingFunction)
Int2IntMapcomputeIntIfAbsent in interface Int2IntMapcomputeIntIfAbsent in class AbstractInt2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic int computeIntIfPresent(int key,
IntIntUnaryOperator mappingFunction)
Int2IntMapcomputeIntIfPresent in interface Int2IntMapcomputeIntIfPresent in class AbstractInt2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic int supplyIntIfAbsent(int key,
IntSupplier valueProvider)
Int2IntMapsupplyIntIfAbsent in interface Int2IntMapsupplyIntIfAbsent in class AbstractInt2IntMapkey - the key that should be computedvalueProvider - the value if not presentpublic int mergeInt(int key,
int value,
IntIntUnaryOperator mappingFunction)
Int2IntMapmergeInt in interface Int2IntMapmergeInt in class AbstractInt2IntMapkey - 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(Int2IntMap m, IntIntUnaryOperator mappingFunction)
Int2IntMapmergeAllInt in interface Int2IntMapmergeAllInt in class AbstractInt2IntMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Integer>keySet in interface Int2IntMapkeySet in class AbstractInt2IntMappublic IntCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Integer>values in interface Int2IntMapvalues in class AbstractInt2IntMappublic ObjectSet<Int2IntMap.Entry> int2IntEntrySet()
Int2IntMappublic Int2IntMaps.EmptyMap copy()
Int2IntMapcopy in interface Int2IntMapcopy in class AbstractInt2IntMap