T - the type of elements maintained by this CollectionV - the type of elements maintained by this Collectionpublic class Object2ObjectOpenHashMap<T,V> extends AbstractObject2ObjectMap<T,V>
AbstractObject2ObjectMap.BasicEntry<T,V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Object2ObjectMap.Entry<T,V>, Object2ObjectMap.FastEntrySet<T,V>| Constructor and Description |
|---|
Object2ObjectOpenHashMap()
Default Constructor
|
Object2ObjectOpenHashMap(int minCapacity)
Constructor that defines the minimum capacity
|
Object2ObjectOpenHashMap(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
Object2ObjectOpenHashMap(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.
|
Object2ObjectOpenHashMap(java.util.Map<? extends T,? extends V> map,
float loadFactor)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Object2ObjectOpenHashMap(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.
|
Object2ObjectOpenHashMap(Object2ObjectMap<T,V> map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Object2ObjectOpenHashMap(T[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Object2ObjectOpenHashMap(T[] keys,
V[] values,
float loadFactor)
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,
Object2ObjectFunction<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)
Deprecated.
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
void |
forEach(ObjectObjectConsumer<T,V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(java.lang.Object key) |
V |
getObject(T key)
Type Specific get function to reduce boxing/unboxing
|
V |
getOrDefault(java.lang.Object key,
V defaultValue) |
ObjectSet<T> |
keySet() |
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.
|
ObjectSet<Object2ObjectMap.Entry<T,V>> |
object2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
V |
put(T key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
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)
Deprecated.
|
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() |
ObjectCollection<V> |
values() |
entrySet, equals, getDefaultReturnValue, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuecompute, computeIfAbsent, computeIfPresent, forEach, merge, putAll, replaceAllapplypublic Object2ObjectOpenHashMap()
public Object2ObjectOpenHashMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Object2ObjectOpenHashMap(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2ObjectOpenHashMap(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 Object2ObjectOpenHashMap(T[] keys, V[] values, float loadFactor)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2ObjectOpenHashMap(java.util.Map<? extends T,? extends V> map)
map - the values that should be present in the mappublic Object2ObjectOpenHashMap(java.util.Map<? extends T,? extends V> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Object2ObjectOpenHashMap(Object2ObjectMap<T,V> map)
map - the values that should be present in the mappublic Object2ObjectOpenHashMap(Object2ObjectMap<T,V> map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public 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)
Object2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<T,V>containsKey in class AbstractObject2ObjectMap<T,V>@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<T,V>containsValue in class AbstractObject2ObjectMap<T,V>public V rem(T key)
Object2ObjectMapkey - the element that should be removedpublic V remOrDefault(T key, V defaultValue)
Object2ObjectMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)@Deprecated public V remove(java.lang.Object key)
remove in interface java.util.Map<T,V>remove in interface Object2ObjectMap<T,V>remove in class java.util.AbstractMap<T,V>key - the element that should be removedMap.remove(Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
public V getObject(T key)
Object2ObjectFunctionkey - the value that should be processedpublic V get(java.lang.Object key)
public V getOrDefault(java.lang.Object key, V defaultValue)
getOrDefault in interface java.util.Map<T,V>getOrDefault in class AbstractObject2ObjectMap<T,V>public ObjectSet<Object2ObjectMap.Entry<T,V>> object2ObjectEntrySet()
Object2ObjectMappublic ObjectSet<T> keySet()
keySet in interface java.util.Map<T,V>keySet in interface Object2ObjectMap<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 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 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, Object2ObjectFunction<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 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()