public class Int2LongArrayMap extends AbstractInt2LongMap implements Int2LongSortedMap
AbstractInt2LongMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2LongSortedMap.FastSortedSetInt2LongMap.Entry, Int2LongMap.FastEntrySet| Constructor and Description |
|---|
Int2LongArrayMap()
Default Constructor
|
Int2LongArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Int2LongArrayMap(int[] keys,
long[] values)
Helper constructor that allow to create a map from unboxed values
|
Int2LongArrayMap(int[] keys,
long[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Int2LongArrayMap(Int2LongMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2LongArrayMap(java.lang.Integer[] keys,
java.lang.Long[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2LongArrayMap(java.lang.Integer[] keys,
java.lang.Long[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Int2LongArrayMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> 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 |
|---|---|
long |
addTo(int key,
long value)
A Helper method to add a primitives together.
|
void |
clear() |
IntComparator |
comparator() |
long |
computeLong(int key,
IntLongUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfAbsent(int key,
Int2LongFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
long |
computeLongIfPresent(int key,
IntLongUnaryOperator 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(long value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
int |
firstIntKey()
A method to get the first Key of a Map.
|
long |
firstLongValue()
A method to get the first Value of a Map.
|
void |
forEach(IntLongConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
long |
getAndMoveToFirst(int key)
A Specific get method that allows to move teh given key/value int the first index.
|
long |
getAndMoveToLast(int key)
A Specific get method that allows to move teh given key/value int the last index.
|
long |
getLong(int key)
A Type Specific get method to reduce boxing/unboxing
|
long |
getOrDefault(int key,
long defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Int2LongSortedMap |
headMap(int toKey)
A Type Specific HeadMap method to reduce boxing/unboxing
|
ObjectSortedSet<Int2LongMap.Entry> |
int2LongEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntSet |
keySet() |
int |
lastIntKey()
A method to get the last Key of a Map.
|
long |
lastLongValue()
A method to get the last Value of a Map.
|
void |
mergeAllLong(Int2LongMap m,
LongLongUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
long |
mergeLong(int key,
long value,
LongLongUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
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.
|
long |
put(int key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
putAndMoveToFirst(int key,
long value)
A customized put method that allows you to insert into the first index.
|
long |
putAndMoveToLast(int key,
long value)
A customized put method that allows you to insert into the last index.
|
long |
putIfAbsent(int key,
long value)
Type Specific method to reduce boxing/unboxing of values
|
long |
remInt(int key)
Type Specific remove function to reduce boxing/unboxing
|
long |
remIntOrDefault(int key,
long defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(int key,
long value)
Type Specific remove function to reduce boxing/unboxing
|
java.lang.Long |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
long |
replace(int key,
long value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
long oldValue,
long newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
Int2LongSortedMap |
subMap(int fromKey,
int toKey)
A Type Specific SubMap method to reduce boxing/unboxing
|
Int2LongSortedMap |
tailMap(int fromKey)
A Type Specific TailMap method to reduce boxing/unboxing
|
LongCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceLongs, replaceLongs, setDefaultReturnValuefirstKey, headMap, lastKey, subMap, tailMapaddToAll, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceLongs, replaceLongs, setDefaultReturnValueapplyAsLongpublic Int2LongArrayMap()
public Int2LongArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Int2LongArrayMap(java.lang.Integer[] keys,
java.lang.Long[] 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 Int2LongArrayMap(java.lang.Integer[] keys,
java.lang.Long[] 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 Int2LongArrayMap(int[] keys,
long[] 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 Int2LongArrayMap(int[] keys,
long[] 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 Int2LongArrayMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Long> map)
map - the values that should be present in the mappublic Int2LongArrayMap(Int2LongMap map)
map - the values that should be present in the mappublic long put(int key,
long value)
Int2LongMapput in interface Int2LongMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public long putIfAbsent(int key,
long value)
Int2LongMapputIfAbsent in interface Int2LongMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public long addTo(int key,
long value)
Int2LongMapaddTo in interface Int2LongMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic long putAndMoveToFirst(int key,
long value)
Int2LongSortedMapputAndMoveToFirst in interface Int2LongSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public long putAndMoveToLast(int key,
long value)
Int2LongSortedMapputAndMoveToLast in interface Int2LongSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(int key)
Int2LongSortedMapmoveToFirst in interface Int2LongSortedMapkey - that should be moved to the first indexpublic boolean moveToLast(int key)
Int2LongSortedMapmoveToLast in interface Int2LongSortedMapkey - that should be moved to the first lastpublic boolean containsKey(int key)
Int2LongMapcontainsKey in interface Int2LongMapcontainsKey in class AbstractInt2LongMapkey - element that is searched forpublic boolean containsValue(long value)
Int2LongMapcontainsValue in interface Int2LongMapcontainsValue in class AbstractInt2LongMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Integer,java.lang.Long>containsKey in interface Int2LongMapcontainsKey in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Integer,java.lang.Long>containsValue in interface Int2LongMapcontainsValue in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>value - that is searched for.Map.containsValue(Object)public long getLong(int key)
Int2LongMapgetLong in interface Int2LongFunctiongetLong in interface Int2LongMapkey - the key that is searched forpublic long getOrDefault(int key,
long defaultValue)
Int2LongMapgetOrDefault in interface Int2LongMapgetOrDefault in class AbstractInt2LongMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic long getAndMoveToFirst(int key)
Int2LongSortedMapgetAndMoveToFirst in interface Int2LongSortedMapkey - that is searched forpublic long getAndMoveToLast(int key)
Int2LongSortedMapgetAndMoveToLast in interface Int2LongSortedMapkey - that is searched forpublic int firstIntKey()
Int2LongSortedMapfirstIntKey in interface Int2LongSortedMappublic int lastIntKey()
Int2LongSortedMaplastIntKey in interface Int2LongSortedMappublic long firstLongValue()
Int2LongSortedMapfirstLongValue in interface Int2LongSortedMappublic long lastLongValue()
Int2LongSortedMaplastLongValue in interface Int2LongSortedMappublic int pollFirstIntKey()
Int2LongSortedMappollFirstIntKey in interface Int2LongSortedMappublic int pollLastIntKey()
Int2LongSortedMappollLastIntKey in interface Int2LongSortedMappublic long remInt(int key)
Int2LongMapremInt in interface Int2LongMapkey - the element that should be removedpublic long remIntOrDefault(int key,
long defaultValue)
Int2LongMapremIntOrDefault in interface Int2LongMapkey - 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,
long value)
Int2LongMapremove in interface Int2LongMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public java.lang.Long remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,java.lang.Long>remove in interface Int2LongMapremove in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>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,java.lang.Long>remove in interface Int2LongMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(IntLongConsumer action)
Int2LongMapforEach in interface Int2LongMapforEach in class AbstractInt2LongMapaction - processor of the values that are iterator overpublic IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Long>keySet in interface java.util.SortedMap<java.lang.Integer,java.lang.Long>keySet in interface Int2LongMapkeySet in interface Int2LongSortedMapkeySet in class AbstractInt2LongMappublic LongCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Long>values in interface java.util.SortedMap<java.lang.Integer,java.lang.Long>values in interface Int2LongMapvalues in interface Int2LongSortedMapvalues in class AbstractInt2LongMappublic ObjectSortedSet<Int2LongMap.Entry> int2LongEntrySet()
Int2LongMapint2LongEntrySet in interface Int2LongMappublic boolean replace(int key,
long oldValue,
long newValue)
Int2LongMapreplace in interface Int2LongMapreplace in class AbstractInt2LongMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public long replace(int key,
long value)
Int2LongMapreplace in interface Int2LongMapreplace in class AbstractInt2LongMapkey - the element that should be searched forvalue - the value to replace with.public long computeLong(int key,
IntLongUnaryOperator mappingFunction)
Int2LongMapcomputeLong in interface Int2LongMapcomputeLong in class AbstractInt2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic long computeLongIfAbsent(int key,
Int2LongFunction mappingFunction)
Int2LongMapcomputeLongIfAbsent in interface Int2LongMapcomputeLongIfAbsent in class AbstractInt2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic long computeLongIfPresent(int key,
IntLongUnaryOperator mappingFunction)
Int2LongMapcomputeLongIfPresent in interface Int2LongMapcomputeLongIfPresent in class AbstractInt2LongMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic long mergeLong(int key,
long value,
LongLongUnaryOperator mappingFunction)
Int2LongMapmergeLong in interface Int2LongMapmergeLong in class AbstractInt2LongMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllLong(Int2LongMap m, LongLongUnaryOperator mappingFunction)
Int2LongMapmergeAllLong in interface Int2LongMapmergeAllLong in class AbstractInt2LongMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
size in interface java.util.Map<java.lang.Integer,java.lang.Long>size in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public void clear()
clear in interface java.util.Map<java.lang.Integer,java.lang.Long>clear in class java.util.AbstractMap<java.lang.Integer,java.lang.Long>public IntComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Integer,java.lang.Long>comparator in interface Int2LongSortedMappublic Int2LongSortedMap subMap(int fromKey, int toKey)
Int2LongSortedMapsubMap in interface Int2LongSortedMapfromKey - where the submap should starttoKey - where the subMap should endpublic Int2LongSortedMap headMap(int toKey)
Int2LongSortedMapheadMap in interface Int2LongSortedMaptoKey - where the headMap should endpublic Int2LongSortedMap tailMap(int fromKey)
Int2LongSortedMaptailMap in interface Int2LongSortedMapfromKey - where the TailMap should start