V - the keyType of elements maintained by this Collectionpublic class Int2ObjectArrayMap<V> extends AbstractInt2ObjectMap<V> implements Int2ObjectOrderedMap<V>
AbstractInt2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2ObjectOrderedMap.FastOrderedSet<V>Int2ObjectMap.BuilderCache<V>, Int2ObjectMap.Entry<V>, Int2ObjectMap.FastEntrySet<V>, Int2ObjectMap.MapBuilder| Constructor and Description |
|---|
Int2ObjectArrayMap()
Default Constructor
|
Int2ObjectArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Int2ObjectArrayMap(int[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Int2ObjectArrayMap(int[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Int2ObjectArrayMap(Int2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ObjectArrayMap(java.lang.Integer[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ObjectArrayMap(java.lang.Integer[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Int2ObjectArrayMap(java.util.Map<? extends java.lang.Integer,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
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 |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
Int2ObjectArrayMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
int |
firstIntKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
void |
forEach(IntObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(int key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getAndMoveToFirst(int key)
A Specific get method that allows to move teh given key/value int the first index.
|
V |
getAndMoveToLast(int key)
A Specific get method that allows to move teh given key/value int the last index.
|
V |
getOrDefault(int key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectOrderedSet<Int2ObjectMap.Entry<V>> |
int2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntOrderedSet |
keySet() |
int |
lastIntKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
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.
|
boolean |
moveToFirst(int key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(int key)
A specific move method to move a given key/value to the last index.
|
int |
pollFirstIntKey()
A method to get and remove the first Key of a Map.
|
int |
pollLastIntKey()
A method to get and remove the last Key of a Map.
|
V |
put(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putAndMoveToFirst(int key,
V value)
A customized put method that allows you to insert into the first index.
|
V |
putAndMoveToLast(int key,
V value)
A customized put method that allows you to insert into the last index.
|
V |
putIfAbsent(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
removeOrDefault(int key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
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
|
int |
size() |
V |
supplyIfAbsent(int key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ObjectCollection<V> |
values() |
entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuesynchronize, synchronize, unmodifiableapply, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic Int2ObjectArrayMap()
public Int2ObjectArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Int2ObjectArrayMap(java.lang.Integer[] keys,
V[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lengthpublic Int2ObjectArrayMap(java.lang.Integer[] keys,
V[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lengthpublic Int2ObjectArrayMap(int[] keys,
V[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Int2ObjectArrayMap(int[] keys,
V[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Int2ObjectArrayMap(java.util.Map<? extends java.lang.Integer,? extends V> map)
map - the values that should be present in the mappublic Int2ObjectArrayMap(Int2ObjectMap<V> map)
map - the values that should be present in the mappublic V put(int key, V value)
Int2ObjectMapput in interface Int2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(int key, V value)
Int2ObjectMapputIfAbsent in interface Int2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V putAndMoveToFirst(int key, V value)
Int2ObjectOrderedMapputAndMoveToFirst in interface Int2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(int key, V value)
Int2ObjectOrderedMapputAndMoveToLast in interface Int2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(int key)
Int2ObjectOrderedMapmoveToFirst in interface Int2ObjectOrderedMap<V>key - that should be moved to the first indexpublic boolean moveToLast(int key)
Int2ObjectOrderedMapmoveToLast in interface Int2ObjectOrderedMap<V>key - that should be moved to the first lastpublic boolean containsKey(int key)
Int2ObjectMapcontainsKey in interface Int2ObjectMap<V>containsKey in class AbstractInt2ObjectMap<V>key - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Integer,V>containsKey in interface Int2ObjectMap<V>containsKey in class java.util.AbstractMap<java.lang.Integer,V>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Integer,V>containsValue in class AbstractInt2ObjectMap<V>public V get(int key)
Int2ObjectMapget in interface Int2ObjectMap<V>key - the key that is searched forpublic V getOrDefault(int key, V defaultValue)
Int2ObjectMapgetOrDefault in interface Int2ObjectMap<V>getOrDefault in class AbstractInt2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic V getAndMoveToFirst(int key)
Int2ObjectOrderedMapgetAndMoveToFirst in interface Int2ObjectOrderedMap<V>key - that is searched forpublic V getAndMoveToLast(int key)
Int2ObjectOrderedMapgetAndMoveToLast in interface Int2ObjectOrderedMap<V>key - that is searched forpublic int firstIntKey()
Int2ObjectOrderedMapfirstIntKey in interface Int2ObjectOrderedMap<V>public int lastIntKey()
Int2ObjectOrderedMaplastIntKey in interface Int2ObjectOrderedMap<V>public V firstValue()
Int2ObjectOrderedMapfirstValue in interface Int2ObjectOrderedMap<V>public V lastValue()
Int2ObjectOrderedMaplastValue in interface Int2ObjectOrderedMap<V>public int pollFirstIntKey()
Int2ObjectOrderedMappollFirstIntKey in interface Int2ObjectOrderedMap<V>public int pollLastIntKey()
Int2ObjectOrderedMappollLastIntKey in interface Int2ObjectOrderedMap<V>public V remove(int key)
Int2ObjectMapremove in interface Int2ObjectMap<V>key - the element that should be removedpublic V removeOrDefault(int key, V defaultValue)
Int2ObjectMapremoveOrDefault in interface Int2ObjectMap<V>key - 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,
V value)
Int2ObjectMapremove in interface Int2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,V>remove in interface Int2ObjectMap<V>remove in class AbstractInt2ObjectMap<V>key - the element that should be removedMap.remove(Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
remove in interface java.util.Map<java.lang.Integer,V>remove in interface Int2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(IntObjectConsumer<V> action)
Int2ObjectMapforEach in interface Int2ObjectMap<V>forEach in class AbstractInt2ObjectMap<V>action - processor of the values that are iterator overpublic IntOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Integer,V>keySet in interface Int2ObjectMap<V>keySet in interface Int2ObjectOrderedMap<V>keySet in class AbstractInt2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Integer,V>values in interface Int2ObjectMap<V>values in class AbstractInt2ObjectMap<V>public ObjectOrderedSet<Int2ObjectMap.Entry<V>> int2ObjectEntrySet()
Int2ObjectMapint2ObjectEntrySet in interface Int2ObjectMap<V>int2ObjectEntrySet in interface Int2ObjectOrderedMap<V>public boolean replace(int key,
V oldValue,
V newValue)
Int2ObjectMapreplace in interface Int2ObjectMap<V>replace in class AbstractInt2ObjectMap<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>replace in class AbstractInt2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcompute in interface Int2ObjectMap<V>compute in class AbstractInt2ObjectMap<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>computeIfAbsent in class AbstractInt2ObjectMap<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>supplyIfAbsent in class AbstractInt2ObjectMap<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>computeIfPresent in class AbstractInt2ObjectMap<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>merge in class AbstractInt2ObjectMap<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>mergeAll in class AbstractInt2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
public void clear()
public Int2ObjectArrayMap<V> copy()
Int2ObjectMapcopy in interface Int2ObjectMap<V>copy in interface Int2ObjectOrderedMap<V>copy in class AbstractInt2ObjectMap<V>