public abstract class AbstractLong2IntMap extends java.util.AbstractMap<java.lang.Long,java.lang.Integer> implements Long2IntMap
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractLong2IntMap.BasicEntry
A Simple Type Specific Entry class to reduce boxing/unboxing
|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2IntMap.Entry, Long2IntMap.FastEntrySet| Constructor and Description |
|---|
AbstractLong2IntMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToAll(Long2IntMap m)
A Helper method to bulk add primitives together.
|
int |
computeInt(long key,
LongIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfAbsent(long key,
Long2IntFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfPresent(long key,
LongIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(int value)
Type Specific method to reduce boxing/unboxing of values
|
ObjectSet<java.util.Map.Entry<java.lang.Long,java.lang.Integer>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
void |
forEach(LongIntConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
java.lang.Integer |
get(java.lang.Object key) |
int |
getDefaultReturnValue()
Method to see what the default return value is.
|
int |
getOrDefault(long key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
java.lang.Integer |
getOrDefault(java.lang.Object key,
java.lang.Integer defaultValue) |
int |
hashCode() |
LongSet |
keySet() |
void |
mergeAllInt(Long2IntMap m,
IntIntUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
int |
mergeInt(long key,
int value,
IntIntUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
putAll(long[] keys,
int[] 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(Long2IntMap m)
Type Specific function for the bull putting of values
|
void |
putAll(java.util.Map<? extends java.lang.Long,? extends java.lang.Integer> m) |
void |
putAllIfAbsent(Long2IntMap m)
Type-Specific bulk put method put elements into the map if not present.
|
int |
replace(long key,
int value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
int oldValue,
int newValue)
A Type Specific replace method to replace an existing value
|
void |
replaceInts(Long2IntMap m)
Type-Specific bulk replace method.
|
void |
replaceInts(LongIntUnaryOperator mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
AbstractLong2IntMap |
setDefaultReturnValue(int v)
Method to define the default return value if a requested key isn't present
|
IntCollection |
values() |
clear, containsKey, containsValue, isEmpty, put, remove, size, toStringaddTo, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getInt, long2IntEntrySet, merge, put, put, putAll, putIfAbsent, putIfAbsent, remLong, remLongOrDefault, remove, remove, remove, replace, replace, replaceAllapplyAsIntpublic int getDefaultReturnValue()
Long2IntMapgetDefaultReturnValue in interface Long2IntMappublic AbstractLong2IntMap setDefaultReturnValue(int v)
Long2IntMapsetDefaultReturnValue in interface Long2IntMapv - value that should be the default return valuepublic void addToAll(Long2IntMap m)
Long2IntMapaddToAll in interface Long2IntMapm - the values that should be added/insertedpublic void putAll(Long2IntMap m)
Long2IntMapputAll in interface Long2IntMapm - the elements that should be insertedpublic void putAll(java.util.Map<? extends java.lang.Long,? extends java.lang.Integer> m)
putAll in interface java.util.Map<java.lang.Long,java.lang.Integer>putAll in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public void putAll(long[] keys,
int[] values,
int offset,
int size)
Long2IntMapputAll in interface Long2IntMapkeys - 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(Long2IntMap m)
Long2IntMapputAllIfAbsent in interface Long2IntMapm - elements that should be added if not present.public boolean containsKey(long key)
Long2IntMapcontainsKey in interface Long2IntMapkey - element that is searched forpublic boolean containsValue(int value)
Long2IntMapcontainsValue in interface Long2IntMapvalue - element that is searched forpublic boolean replace(long key,
int oldValue,
int newValue)
Long2IntMapreplace in interface Long2IntMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public int replace(long key,
int value)
Long2IntMapreplace in interface Long2IntMapkey - the element that should be searched forvalue - the value to replace with.public void replaceInts(Long2IntMap m)
Long2IntMapreplaceInts in interface Long2IntMapm - elements that should be replaced.public void replaceInts(LongIntUnaryOperator mappingFunction)
Long2IntMapreplaceInts in interface Long2IntMapmappingFunction - operation to replace all valuespublic int computeInt(long key,
LongIntUnaryOperator mappingFunction)
Long2IntMapcomputeInt in interface Long2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic int computeIntIfAbsent(long key,
Long2IntFunction mappingFunction)
Long2IntMapcomputeIntIfAbsent in interface Long2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic int computeIntIfPresent(long key,
LongIntUnaryOperator mappingFunction)
Long2IntMapcomputeIntIfPresent in interface Long2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic int mergeInt(long key,
int value,
IntIntUnaryOperator mappingFunction)
Long2IntMapmergeInt in interface Long2IntMapkey - 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(Long2IntMap m, IntIntUnaryOperator mappingFunction)
Long2IntMapmergeAllInt in interface Long2IntMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic java.lang.Integer get(java.lang.Object key)
get in interface java.util.Map<java.lang.Long,java.lang.Integer>get in interface Long2IntMapget in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public java.lang.Integer getOrDefault(java.lang.Object key,
java.lang.Integer defaultValue)
getOrDefault in interface java.util.Map<java.lang.Long,java.lang.Integer>getOrDefault in interface Long2IntMappublic int getOrDefault(long key,
int defaultValue)
Long2IntMapgetOrDefault in interface Long2IntMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic void forEach(LongIntConsumer action)
Long2IntMapforEach in interface Long2IntMapaction - processor of the values that are iterator overpublic LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Integer>keySet in interface Long2IntMapkeySet in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public IntCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Integer>values in interface Long2IntMapvalues in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public ObjectSet<java.util.Map.Entry<java.lang.Long,java.lang.Integer>> entrySet()
entrySet in interface java.util.Map<java.lang.Long,java.lang.Integer>entrySet in interface Long2IntMapentrySet in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public boolean equals(java.lang.Object o)
equals in interface java.util.Map<java.lang.Long,java.lang.Integer>equals in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>public int hashCode()
hashCode in interface java.util.Map<java.lang.Long,java.lang.Integer>hashCode in class java.util.AbstractMap<java.lang.Long,java.lang.Integer>