public abstract class AbstractInt2LongMap extends java.util.AbstractMap<java.lang.Integer,java.lang.Long> implements Int2LongMap
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractInt2LongMap.BasicEntry
A Simple Type Specific Entry class to reduce boxing/unboxing
|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2LongMap.BuilderCache, Int2LongMap.Entry, Int2LongMap.FastEntrySet, Int2LongMap.MapBuilder| Constructor and Description |
|---|
AbstractInt2LongMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToAll(Int2LongMap m)
A Helper method to bulk add primitives together.
|
long |
computeLong(int key,
IntLongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfAbsent(int key,
Int2LongFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfPresent(int key,
IntLongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(int key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(long value)
Type Specific method to reduce boxing/unboxing of values
|
Int2LongMap |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<java.lang.Integer,java.lang.Long>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
void |
forEach(IntLongConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Long |
get(java.lang.Object key) |
long |
getDefaultReturnValue()
Method to see what the default return value is.
|
long |
getOrDefault(int key,
long defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
java.lang.Long |
getOrDefault(java.lang.Object key,
java.lang.Long defaultValue) |
int |
hashCode() |
IntSet |
keySet() |
void |
mergeAllLong(Int2LongMap m,
LongLongUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
long |
mergeLong(int key,
long value,
LongLongUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
java.lang.Long |
put(java.lang.Integer key,
java.lang.Long value)
Deprecated.
|
void |
putAll(int[] keys,
long[] values,
int offset,
int size)
Type Specific array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(Int2LongMap m)
Type Specific function for the bull putting of values
|
void |
putAll(java.lang.Integer[] keys,
java.lang.Long[] values,
int offset,
int size)
Type Specific Object array method to bulk add elements into a map without creating a wrapper and increasing performances
|
void |
putAll(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> m) |
void |
putAllIfAbsent(Int2LongMap m)
Type-Specific bulk put method put elements into the map if not present.
|
java.lang.Long |
remove(java.lang.Object key) |
long |
replace(int key,
long value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
long oldValue,
long newValue)
A Type Specific replace method to replace an existing value
|
void |
replaceLongs(Int2LongMap m)
Type-Specific bulk replace method.
|
void |
replaceLongs(IntLongUnaryOperator mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
AbstractInt2LongMap |
setDefaultReturnValue(long v)
Method to define the default return value if a requested key isn't present
|
long |
supplyLongIfAbsent(int key,
LongSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
LongCollection |
values() |
clear, containsKey, containsValue, isEmpty, size, toStringaddTo, applyAsLong, builder, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, get, int2LongEntrySet, merge, put, put, put, putAll, putAll, putIfAbsent, putIfAbsent, remove, remove, remove, removeOrDefault, replace, replace, replaceAll, subFrom, synchronize, synchronize, unmodifiablepublic long getDefaultReturnValue()
Int2LongMapgetDefaultReturnValue in interface Int2LongMappublic AbstractInt2LongMap setDefaultReturnValue(long v)
Int2LongMapsetDefaultReturnValue in interface Int2LongMapv - value that should be the default return valuepublic Int2LongMap copy()
Int2LongMapcopy in interface Int2LongMap@Deprecated
public java.lang.Long put(java.lang.Integer key,
java.lang.Long value)
put in interface java.util.Map<java.lang.Integer,java.lang.Long>put in interface Int2LongMapput in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public void addToAll(Int2LongMap m)
Int2LongMapaddToAll in interface Int2LongMapm - the values that should be added/insertedpublic void putAll(Int2LongMap m)
Int2LongMapputAll in interface Int2LongMapm - the elements that should be insertedpublic void putAll(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> m)
putAll in interface java.util.Map<java.lang.Integer,java.lang.Long>putAll in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public void putAll(int[] keys,
long[] values,
int offset,
int size)
Int2LongMapputAll in interface Int2LongMapkeys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedMap.putAll(Map)public void putAll(java.lang.Integer[] keys,
java.lang.Long[] values,
int offset,
int size)
Int2LongMapputAll in interface Int2LongMapkeys - the keys that should be addedvalues - the values that should be addedoffset - where the to start in the arraysize - how many elements should be addedMap.putAll(Map)public void putAllIfAbsent(Int2LongMap m)
Int2LongMapputAllIfAbsent in interface Int2LongMapm - elements that should be added if not present.public boolean containsKey(int key)
Int2LongMapcontainsKey in interface Int2LongMapkey - element that is searched forpublic boolean containsValue(long value)
Int2LongMapcontainsValue in interface Int2LongMapvalue - element that is searched forpublic boolean replace(int key,
long oldValue,
long newValue)
Int2LongMapreplace in interface Int2LongMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public long replace(int key,
long value)
Int2LongMapreplace in interface Int2LongMapkey - the element that should be searched forvalue - the value to replace with.public void replaceLongs(Int2LongMap m)
Int2LongMapreplaceLongs in interface Int2LongMapm - elements that should be replaced.public void replaceLongs(IntLongUnaryOperator mappingFunction)
Int2LongMapreplaceLongs in interface Int2LongMapmappingFunction - operation to replace all valuespublic long computeLong(int key,
IntLongUnaryOperator mappingFunction)
Int2LongMapcomputeLong in interface Int2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic long computeLongIfAbsent(int key,
Int2LongFunction mappingFunction)
Int2LongMapcomputeLongIfAbsent in interface Int2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic long supplyLongIfAbsent(int key,
LongSupplier valueProvider)
Int2LongMapsupplyLongIfAbsent in interface Int2LongMapkey - the key that should be computedvalueProvider - the value if not presentpublic long computeLongIfPresent(int key,
IntLongUnaryOperator mappingFunction)
Int2LongMapcomputeLongIfPresent in interface Int2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic long mergeLong(int key,
long value,
LongLongUnaryOperator mappingFunction)
Int2LongMapmergeLong in interface Int2LongMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllLong(Int2LongMap m, LongLongUnaryOperator mappingFunction)
Int2LongMapmergeAllLong in interface Int2LongMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic java.lang.Long get(java.lang.Object key)
get in interface java.util.Map<java.lang.Integer,java.lang.Long>get in interface Int2LongMapget in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public java.lang.Long getOrDefault(java.lang.Object key,
java.lang.Long defaultValue)
getOrDefault in interface java.util.Map<java.lang.Integer,java.lang.Long>getOrDefault in interface Int2LongMappublic long getOrDefault(int key,
long defaultValue)
Int2LongMapgetOrDefault in interface Int2LongMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic java.lang.Long remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,java.lang.Long>remove in interface Int2LongMapremove in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>key - the element that should be removedMap.remove(Object)public void forEach(IntLongConsumer action)
Int2LongMapforEach in interface Int2LongMapaction - processor of the values that are iterator overpublic IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Long>keySet in interface Int2LongMapkeySet in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public LongCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Long>values in interface Int2LongMapvalues in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public ObjectSet<java.util.Map.Entry<java.lang.Integer,java.lang.Long>> entrySet()
entrySet in interface java.util.Map<java.lang.Integer,java.lang.Long>entrySet in interface Int2LongMapentrySet in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public boolean equals(java.lang.Object o)
equals in interface java.util.Map<java.lang.Integer,java.lang.Long>equals in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public int hashCode()
hashCode in interface java.util.Map<java.lang.Integer,java.lang.Long>hashCode in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>