V - the type of elements maintained by this Collectionpublic class Short2ObjectArrayMap<V> extends AbstractShort2ObjectMap<V> implements Short2ObjectSortedMap<V>
AbstractShort2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Short2ObjectSortedMap.FastSortedSet<V>Short2ObjectMap.Entry<V>, Short2ObjectMap.FastEntrySet<V>| Constructor and Description |
|---|
Short2ObjectArrayMap()
Default Constructor
|
Short2ObjectArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Short2ObjectArrayMap(java.util.Map<? extends java.lang.Short,? extends V> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Short2ObjectArrayMap(short[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Short2ObjectArrayMap(java.lang.Short[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Short2ObjectArrayMap(short[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Short2ObjectArrayMap(java.lang.Short[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Short2ObjectArrayMap(Short2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
ShortComparator |
comparator() |
V |
compute(short key,
ShortObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(short key,
Short2ObjectFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(short key,
ShortObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsKey(short key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
short |
firstShortKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
void |
forEach(ShortObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
getAndMoveToFirst(short key)
A Specific get method that allows to move teh given key/value int the first index.
|
V |
getAndMoveToLast(short key)
A Specific get method that allows to move teh given key/value int the last index.
|
V |
getObject(short key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(short key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Short2ObjectSortedMap<V> |
headMap(short toKey)
A Type Specific HeadMap method to reduce boxing/unboxing
|
ShortSet |
keySet() |
short |
lastShortKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
V |
merge(short key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Short2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
boolean |
moveToFirst(short key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(short key)
A specific move method to move a given key/value to the last index.
|
short |
pollFirstShortKey()
A method to get and remove the first Key of a Map.
|
short |
pollLastShortKey()
A method to get and remove the last Key of a Map.
|
V |
put(short key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putAndMoveToFirst(short key,
V value)
A customized put method that allows you to insert into the first index.
|
V |
putAndMoveToLast(short key,
V value)
A customized put method that allows you to insert into the last index.
|
V |
putIfAbsent(short key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
boolean |
remove(short key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
remShort(short key)
Type Specific remove function to reduce boxing/unboxing
|
V |
remShortOrDefault(short key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
replace(short key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(short key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
ObjectSortedSet<Short2ObjectMap.Entry<V>> |
short2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
int |
size() |
Short2ObjectSortedMap<V> |
subMap(short fromKey,
short toKey)
A Type Specific SubMap method to reduce boxing/unboxing
|
Short2ObjectSortedMap<V> |
tailMap(short fromKey)
A Type Specific TailMap method to reduce boxing/unboxing
|
ObjectCollection<V> |
values() |
entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuefirstKey, headMap, lastKey, subMap, tailMapcompute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic Short2ObjectArrayMap()
public Short2ObjectArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Short2ObjectArrayMap(java.lang.Short[] 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 Short2ObjectArrayMap(java.lang.Short[] 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 Short2ObjectArrayMap(short[] 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 Short2ObjectArrayMap(short[] 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 Short2ObjectArrayMap(java.util.Map<? extends java.lang.Short,? extends V> map)
map - the values that should be present in the mappublic Short2ObjectArrayMap(Short2ObjectMap<V> map)
map - the values that should be present in the mappublic V put(short key, V value)
Short2ObjectMapput in interface Short2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(short key, V value)
Short2ObjectMapputIfAbsent in interface Short2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V putAndMoveToFirst(short key, V value)
Short2ObjectSortedMapputAndMoveToFirst in interface Short2ObjectSortedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(short key, V value)
Short2ObjectSortedMapputAndMoveToLast in interface Short2ObjectSortedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(short key)
Short2ObjectSortedMapmoveToFirst in interface Short2ObjectSortedMap<V>key - that should be moved to the first indexpublic boolean moveToLast(short key)
Short2ObjectSortedMapmoveToLast in interface Short2ObjectSortedMap<V>key - that should be moved to the first lastpublic boolean containsKey(short key)
Short2ObjectMapcontainsKey in interface Short2ObjectMap<V>containsKey in class AbstractShort2ObjectMap<V>key - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Short,V>containsKey in interface Short2ObjectMap<V>containsKey in class java.util.AbstractMap<java.lang.Short,V>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Short,V>containsValue in class AbstractShort2ObjectMap<V>public V getObject(short key)
Short2ObjectMapgetObject in interface Short2ObjectFunction<V>getObject in interface Short2ObjectMap<V>key - the key that is searched forpublic V getOrDefault(short key, V defaultValue)
Short2ObjectMapgetOrDefault in interface Short2ObjectMap<V>getOrDefault in class AbstractShort2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic V getAndMoveToFirst(short key)
Short2ObjectSortedMapgetAndMoveToFirst in interface Short2ObjectSortedMap<V>key - that is searched forpublic V getAndMoveToLast(short key)
Short2ObjectSortedMapgetAndMoveToLast in interface Short2ObjectSortedMap<V>key - that is searched forpublic short firstShortKey()
Short2ObjectSortedMapfirstShortKey in interface Short2ObjectSortedMap<V>public short lastShortKey()
Short2ObjectSortedMaplastShortKey in interface Short2ObjectSortedMap<V>public V firstValue()
Short2ObjectSortedMapfirstValue in interface Short2ObjectSortedMap<V>public V lastValue()
Short2ObjectSortedMaplastValue in interface Short2ObjectSortedMap<V>public short pollFirstShortKey()
Short2ObjectSortedMappollFirstShortKey in interface Short2ObjectSortedMap<V>public short pollLastShortKey()
Short2ObjectSortedMappollLastShortKey in interface Short2ObjectSortedMap<V>public V remShort(short key)
Short2ObjectMapremShort in interface Short2ObjectMap<V>key - the element that should be removedpublic V remShortOrDefault(short key, V defaultValue)
Short2ObjectMapremShortOrDefault in interface Short2ObjectMap<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(short key,
V value)
Short2ObjectMapremove in interface Short2ObjectMap<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.Short,V>remove in interface Short2ObjectMap<V>remove in class java.util.AbstractMap<java.lang.Short,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.Short,V>remove in interface Short2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(ShortObjectConsumer<V> action)
Short2ObjectMapforEach in interface Short2ObjectMap<V>forEach in class AbstractShort2ObjectMap<V>action - processor of the values that are iterator overpublic ShortSet keySet()
keySet in interface java.util.Map<java.lang.Short,V>keySet in interface java.util.SortedMap<java.lang.Short,V>keySet in interface Short2ObjectMap<V>keySet in interface Short2ObjectSortedMap<V>keySet in class AbstractShort2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Short,V>values in interface java.util.SortedMap<java.lang.Short,V>values in interface Short2ObjectMap<V>values in interface Short2ObjectSortedMap<V>values in class AbstractShort2ObjectMap<V>public ObjectSortedSet<Short2ObjectMap.Entry<V>> short2ObjectEntrySet()
Short2ObjectMapshort2ObjectEntrySet in interface Short2ObjectMap<V>public boolean replace(short key,
V oldValue,
V newValue)
Short2ObjectMapreplace in interface Short2ObjectMap<V>replace in class AbstractShort2ObjectMap<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(short key, V value)
Short2ObjectMapreplace in interface Short2ObjectMap<V>replace in class AbstractShort2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(short key, ShortObjectUnaryOperator<V> mappingFunction)
Short2ObjectMapcompute in interface Short2ObjectMap<V>compute in class AbstractShort2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(short key, Short2ObjectFunction<V> mappingFunction)
Short2ObjectMapcomputeIfAbsent in interface Short2ObjectMap<V>computeIfAbsent in class AbstractShort2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V computeIfPresent(short key, ShortObjectUnaryOperator<V> mappingFunction)
Short2ObjectMapcomputeIfPresent in interface Short2ObjectMap<V>computeIfPresent in class AbstractShort2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(short key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Short2ObjectMapmerge in interface Short2ObjectMap<V>merge in class AbstractShort2ObjectMap<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(Short2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Short2ObjectMapmergeAll in interface Short2ObjectMap<V>mergeAll in class AbstractShort2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
public void clear()
public ShortComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Short,V>comparator in interface Short2ObjectSortedMap<V>public Short2ObjectSortedMap<V> subMap(short fromKey, short toKey)
Short2ObjectSortedMapsubMap in interface Short2ObjectSortedMap<V>fromKey - where the submap should starttoKey - where the subMap should endpublic Short2ObjectSortedMap<V> headMap(short toKey)
Short2ObjectSortedMapheadMap in interface Short2ObjectSortedMap<V>toKey - where the headMap should endpublic Short2ObjectSortedMap<V> tailMap(short fromKey)
Short2ObjectSortedMaptailMap in interface Short2ObjectSortedMap<V>fromKey - where the TailMap should start