T - the keyType of elements maintained by this CollectionV - the keyType of elements maintained by this Collectionpublic class Object2ObjectArrayMap<T,V> extends AbstractObject2ObjectMap<T,V> implements Object2ObjectOrderedMap<T,V>
AbstractObject2ObjectMap.BasicEntry<T,V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2ObjectOrderedMap.FastOrderedSet<T,V>Object2ObjectMap.BuilderCache<T,V>, Object2ObjectMap.Entry<T,V>, Object2ObjectMap.FastEntrySet<T,V>, Object2ObjectMap.MapBuilder| Constructor and Description |
|---|
Object2ObjectArrayMap()
Default Constructor
|
Object2ObjectArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Object2ObjectArrayMap(java.util.Map<? extends T,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2ObjectArrayMap(Object2ObjectMap<T,V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2ObjectArrayMap(T[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2ObjectArrayMap(T[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
V |
compute(T key,
ObjectObjectUnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(T key,
UnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(T key,
ObjectObjectUnaryOperator<T,V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
Object2ObjectArrayMap<T,V> |
copy()
A Function that does a shallow clone of the Map itself.
|
T |
firstKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
void |
forEach(ObjectObjectConsumer<T,V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
getAndMoveToFirst(T key)
A Specific get method that allows to move teh given key/value int the first index.
|
V |
getAndMoveToLast(T key)
A Specific get method that allows to move teh given key/value int the last index.
|
V |
getObject(T key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(java.lang.Object key,
V defaultValue) |
ObjectOrderedSet<T> |
keySet() |
T |
lastKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
V |
merge(T key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Object2ObjectMap<T,V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
boolean |
moveToFirst(T key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(T key)
A specific move method to move a given key/value to the last index.
|
ObjectOrderedSet<Object2ObjectMap.Entry<T,V>> |
object2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
T |
pollFirstKey()
A method to get and remove the first Key of a Map.
|
T |
pollLastKey()
A method to get and remove the last Key of a Map.
|
V |
put(T key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putAndMoveToFirst(T key,
V value)
A customized put method that allows you to insert into the first index.
|
V |
putAndMoveToLast(T key,
V value)
A customized put method that allows you to insert into the last index.
|
V |
putIfAbsent(T key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
rem(T key)
Type Specific remove function to reduce boxing/unboxing
|
V |
remOrDefault(T key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
replace(T key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(T key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
V |
supplyIfAbsent(T 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, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuesynchronize, synchronize, unmodifiableapply, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, getDefaultReturnValue, merge, put, putAll, putAll, putAll, putAllIfAbsent, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValueandThen, compose, identitypublic Object2ObjectArrayMap()
public Object2ObjectArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Object2ObjectArrayMap(T[] 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 Object2ObjectArrayMap(T[] 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 Object2ObjectArrayMap(java.util.Map<? extends T,? extends V> map)
map - the values that should be present in the mappublic Object2ObjectArrayMap(Object2ObjectMap<T,V> map)
map - the values that should be present in the mappublic V put(T key, V value)
Object2ObjectMapput in interface java.util.Map<T,V>put in interface Object2ObjectMap<T,V>put in class java.util.AbstractMap<T,V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(T key, V value)
Object2ObjectMapputIfAbsent in interface java.util.Map<T,V>putIfAbsent in interface Object2ObjectMap<T,V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V putAndMoveToFirst(T key, V value)
Object2ObjectOrderedMapputAndMoveToFirst in interface Object2ObjectOrderedMap<T,V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(T key, V value)
Object2ObjectOrderedMapputAndMoveToLast in interface Object2ObjectOrderedMap<T,V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(T key)
Object2ObjectOrderedMapmoveToFirst in interface Object2ObjectOrderedMap<T,V>key - that should be moved to the first indexpublic boolean moveToLast(T key)
Object2ObjectOrderedMapmoveToLast in interface Object2ObjectOrderedMap<T,V>key - that should be moved to the first lastpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,V>containsKey in class AbstractObject2ObjectMap<T,V>public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<T,V>containsValue in class AbstractObject2ObjectMap<T,V>public V getObject(T key)
Object2ObjectMapgetObject in interface Object2ObjectMap<T,V>key - the key that is searched forpublic V getOrDefault(java.lang.Object key, V defaultValue)
getOrDefault in interface java.util.Map<T,V>getOrDefault in class AbstractObject2ObjectMap<T,V>public V getAndMoveToFirst(T key)
Object2ObjectOrderedMapgetAndMoveToFirst in interface Object2ObjectOrderedMap<T,V>key - that is searched forpublic V getAndMoveToLast(T key)
Object2ObjectOrderedMapgetAndMoveToLast in interface Object2ObjectOrderedMap<T,V>key - that is searched forpublic T firstKey()
Object2ObjectOrderedMapfirstKey in interface Object2ObjectOrderedMap<T,V>public T lastKey()
Object2ObjectOrderedMaplastKey in interface Object2ObjectOrderedMap<T,V>public V firstValue()
Object2ObjectOrderedMapfirstValue in interface Object2ObjectOrderedMap<T,V>public V lastValue()
Object2ObjectOrderedMaplastValue in interface Object2ObjectOrderedMap<T,V>public T pollFirstKey()
Object2ObjectOrderedMappollFirstKey in interface Object2ObjectOrderedMap<T,V>public T pollLastKey()
Object2ObjectOrderedMappollLastKey in interface Object2ObjectOrderedMap<T,V>public V rem(T key)
Object2ObjectMaprem in interface Object2ObjectMap<T,V>key - the element that should be removedpublic V remOrDefault(T key, V defaultValue)
Object2ObjectMapremOrDefault in interface Object2ObjectMap<T,V>key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public V remove(java.lang.Object key)
remove in interface java.util.Map<T,V>remove in interface Object2ObjectMap<T,V>remove in class AbstractObject2ObjectMap<T,V>key - the element that should be removedMap.remove(Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
public void forEach(ObjectObjectConsumer<T,V> action)
Object2ObjectMapforEach in interface Object2ObjectMap<T,V>forEach in class AbstractObject2ObjectMap<T,V>action - processor of the values that are iterator overpublic ObjectOrderedSet<T> keySet()
keySet in interface java.util.Map<T,V>keySet in interface Object2ObjectMap<T,V>keySet in interface Object2ObjectOrderedMap<T,V>keySet in class AbstractObject2ObjectMap<T,V>public ObjectCollection<V> values()
values in interface java.util.Map<T,V>values in interface Object2ObjectMap<T,V>values in class AbstractObject2ObjectMap<T,V>public ObjectOrderedSet<Object2ObjectMap.Entry<T,V>> object2ObjectEntrySet()
Object2ObjectMapobject2ObjectEntrySet in interface Object2ObjectMap<T,V>object2ObjectEntrySet in interface Object2ObjectOrderedMap<T,V>public boolean replace(T key, V oldValue, V newValue)
Object2ObjectMapreplace in interface java.util.Map<T,V>replace in interface Object2ObjectMap<T,V>replace in class AbstractObject2ObjectMap<T,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(T key, V value)
Object2ObjectMapreplace in interface java.util.Map<T,V>replace in interface Object2ObjectMap<T,V>replace in class AbstractObject2ObjectMap<T,V>key - the element that should be searched forvalue - the value to replace with.public V compute(T key, ObjectObjectUnaryOperator<T,V> mappingFunction)
Object2ObjectMapcompute in interface Object2ObjectMap<T,V>compute in class AbstractObject2ObjectMap<T,V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(T key, UnaryOperator<T,V> mappingFunction)
Object2ObjectMapcomputeIfAbsent in interface Object2ObjectMap<T,V>computeIfAbsent in class AbstractObject2ObjectMap<T,V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V supplyIfAbsent(T key, ObjectSupplier<V> valueProvider)
Object2ObjectMapsupplyIfAbsent in interface Object2ObjectMap<T,V>supplyIfAbsent in class AbstractObject2ObjectMap<T,V>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(T key, ObjectObjectUnaryOperator<T,V> mappingFunction)
Object2ObjectMapcomputeIfPresent in interface Object2ObjectMap<T,V>computeIfPresent in class AbstractObject2ObjectMap<T,V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(T key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Object2ObjectMapmerge in interface Object2ObjectMap<T,V>merge in class AbstractObject2ObjectMap<T,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(Object2ObjectMap<T,V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Object2ObjectMapmergeAll in interface Object2ObjectMap<T,V>mergeAll in class AbstractObject2ObjectMap<T,V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
public void clear()
public Object2ObjectArrayMap<T,V> copy()
Object2ObjectMapcopy in interface Object2ObjectMap<T,V>copy in interface Object2ObjectOrderedMap<T,V>copy in class AbstractObject2ObjectMap<T,V>