V - the keyType of elements maintained by this Collectionpublic abstract class AbstractInt2ObjectMap<V> extends java.util.AbstractMap<java.lang.Integer,V> implements Int2ObjectMap<V>
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractInt2ObjectMap.BasicEntry<V>
A Simple Type Specific Entry class to reduce boxing/unboxing
|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2ObjectMap.BuilderCache<V>, Int2ObjectMap.Entry<V>, Int2ObjectMap.FastEntrySet<V>, Int2ObjectMap.MapBuilder| Constructor and Description |
|---|
AbstractInt2ObjectMap() |
| Modifier and Type | Method and Description |
|---|---|
V |
compute(int key,
IntObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(int key,
IntFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(int key,
IntObjectUnaryOperator<V> 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(java.lang.Object value) |
Int2ObjectMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<java.util.Map.Entry<java.lang.Integer,V>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
void |
forEach(IntObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(java.lang.Object key) |
V |
getDefaultReturnValue()
Method to see what the default return value is.
|
V |
getOrDefault(int key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
V |
getOrDefault(java.lang.Object key,
V defaultValue) |
int |
hashCode() |
IntSet |
keySet() |
V |
merge(int key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Int2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
V |
put(java.lang.Integer key,
V value)
Deprecated.
|
void |
putAll(int[] keys,
V[] 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(Int2ObjectMap<V> m)
Type Specific function for the bull putting of values
|
void |
putAll(java.lang.Integer[] keys,
V[] 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 V> m) |
void |
putAllIfAbsent(Int2ObjectMap<V> m)
Type-Specific bulk put method put elements into the map if not present.
|
V |
remove(java.lang.Object key) |
V |
replace(int key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
void |
replaceObjects(Int2ObjectMap<V> m)
Type-Specific bulk replace method.
|
void |
replaceObjects(IntObjectUnaryOperator<V> mappingFunction)
A Type Specific mass replace method to reduce boxing/unboxing
|
AbstractInt2ObjectMap<V> |
setDefaultReturnValue(V v)
Method to define the default return value if a requested key isn't present
|
V |
supplyIfAbsent(int key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ObjectCollection<V> |
values() |
apply, builder, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, get, int2ObjectEntrySet, merge, put, put, put, putAll, putAll, putIfAbsent, putIfAbsent, remove, remove, remove, removeOrDefault, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic V getDefaultReturnValue()
Int2ObjectMapgetDefaultReturnValue in interface Int2ObjectMap<V>public AbstractInt2ObjectMap<V> setDefaultReturnValue(V v)
Int2ObjectMapsetDefaultReturnValue in interface Int2ObjectMap<V>v - value that should be the default return valuepublic Int2ObjectMap<V> copy()
Int2ObjectMapcopy in interface Int2ObjectMap<V>@Deprecated public V put(java.lang.Integer key, V value)
put in interface java.util.Map<java.lang.Integer,V>put in interface Int2ObjectMap<V>put in class java.util.AbstractMap<java.lang.Integer,V>public void putAll(Int2ObjectMap<V> m)
Int2ObjectMapputAll in interface Int2ObjectMap<V>m - the elements that should be insertedpublic void putAll(java.util.Map<? extends java.lang.Integer,? extends V> m)
public void putAll(int[] keys,
V[] values,
int offset,
int size)
Int2ObjectMapputAll in interface Int2ObjectMap<V>keys - 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,
V[] values,
int offset,
int size)
Int2ObjectMapputAll in interface Int2ObjectMap<V>keys - 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(Int2ObjectMap<V> m)
Int2ObjectMapputAllIfAbsent in interface Int2ObjectMap<V>m - elements that should be added if not present.public boolean containsKey(int key)
Int2ObjectMapcontainsKey in interface Int2ObjectMap<V>key - element that is searched forpublic boolean containsValue(java.lang.Object value)
public boolean replace(int key,
V oldValue,
V newValue)
Int2ObjectMapreplace in interface Int2ObjectMap<V>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public V replace(int key, V value)
Int2ObjectMapreplace in interface Int2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public void replaceObjects(Int2ObjectMap<V> m)
Int2ObjectMapreplaceObjects in interface Int2ObjectMap<V>m - elements that should be replaced.public void replaceObjects(IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapreplaceObjects in interface Int2ObjectMap<V>mappingFunction - operation to replace all valuespublic V compute(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcompute in interface Int2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(int key, IntFunction<V> mappingFunction)
Int2ObjectMapcomputeIfAbsent in interface Int2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V supplyIfAbsent(int key, ObjectSupplier<V> valueProvider)
Int2ObjectMapsupplyIfAbsent in interface Int2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcomputeIfPresent in interface Int2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(int key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmerge in interface Int2ObjectMap<V>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAll(Int2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmergeAll in interface Int2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic V get(java.lang.Object key)
get in interface java.util.Map<java.lang.Integer,V>get in interface Int2ObjectMap<V>get in class java.util.AbstractMap<java.lang.Integer,V>public V getOrDefault(java.lang.Object key, V defaultValue)
getOrDefault in interface java.util.Map<java.lang.Integer,V>getOrDefault in interface Int2ObjectMap<V>public V getOrDefault(int key, V defaultValue)
Int2ObjectMapgetOrDefault in interface Int2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,V>remove in interface Int2ObjectMap<V>remove in class java.util.AbstractMap<java.lang.Integer,V>key - the element that should be removedMap.remove(Object)public void forEach(IntObjectConsumer<V> action)
Int2ObjectMapforEach in interface Int2ObjectMap<V>action - processor of the values that are iterator overpublic IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,V>keySet in interface Int2ObjectMap<V>keySet in class java.util.AbstractMap<java.lang.Integer,V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Integer,V>values in interface Int2ObjectMap<V>values in class java.util.AbstractMap<java.lang.Integer,V>public ObjectSet<java.util.Map.Entry<java.lang.Integer,V>> entrySet()
entrySet in interface java.util.Map<java.lang.Integer,V>entrySet in interface Int2ObjectMap<V>entrySet in class java.util.AbstractMap<java.lang.Integer,V>public boolean equals(java.lang.Object o)