public class Int2IntHashMap
extends java.lang.Object
implements java.util.Map<java.lang.Integer,java.lang.Integer>
| Modifier and Type | Class and Description |
|---|---|
class |
Int2IntHashMap.IntIterator |
class |
Int2IntHashMap.KeySet |
class |
Int2IntHashMap.Values |
| Constructor and Description |
|---|
Int2IntHashMap(int missingValue) |
Int2IntHashMap(int initialCapacity,
float loadFactor,
int missingValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
void |
compact()
Compact the backing arrays by rehashing with a capacity just larger than current size
and giving consideration to the load factor.
|
int |
computeIfAbsent(int key,
java.util.function.IntUnaryOperator mappingFunction)
Primitive specialised version of
Map.computeIfAbsent(Object, Function) |
boolean |
containsKey(int key)
Int primitive specialised containsKey.
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(int value) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>> |
entrySet() |
void |
forEach(java.util.function.BiConsumer<? super java.lang.Integer,? super java.lang.Integer> action) |
int |
get(int key) |
java.lang.Integer |
get(java.lang.Object key) |
void |
intForEach(IntIntConsumer consumer)
Primitive specialised forEach implementation.
|
boolean |
isEmpty() |
Int2IntHashMap.KeySet |
keySet() |
float |
loadFactor()
Get the load factor applied for resize operations.
|
int |
maxValue()
Get the maximum value stored in the map.
|
int |
minValue()
Get the minimum value stored in the map.
|
int |
missingValue()
The value to be used as a null marker in the map.
|
java.lang.Integer |
put(java.lang.Integer key,
java.lang.Integer value) |
int |
put(int key,
int value) |
void |
putAll(java.util.Map<? extends java.lang.Integer,? extends java.lang.Integer> map) |
int |
remove(int key) |
java.lang.Integer |
remove(java.lang.Object key) |
int |
replace(int key,
int value)
Primitive specialised version of
Map.replace(Object, Object) |
boolean |
replace(int key,
int oldValue,
int newValue)
Primitive specialised version of
Map.replace(Object, Object, Object) |
int |
size() |
java.lang.String |
toString() |
Int2IntHashMap.Values |
values() |
public Int2IntHashMap(int missingValue)
public Int2IntHashMap(int initialCapacity,
float loadFactor,
int missingValue)
public int missingValue()
public float loadFactor()
public int size()
size in interface java.util.Map<java.lang.Integer,java.lang.Integer>public boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.Integer,java.lang.Integer>public int get(int key)
public int put(int key,
int value)
public void intForEach(IntIntConsumer consumer)
NB: Renamed from forEach to avoid overloading on parameter types of lambda expression, which doesn't interplay well with type inference in lambda expressions.
consumer - a callback called for each key/value pair in the map.public boolean containsKey(int key)
key - the key to check.public boolean containsValue(int value)
public void clear()
clear in interface java.util.Map<java.lang.Integer,java.lang.Integer>public void compact()
public int computeIfAbsent(int key,
java.util.function.IntUnaryOperator mappingFunction)
Map.computeIfAbsent(Object, Function)key - to search on.mappingFunction - to provide a value if the get returns null.public java.lang.Integer get(java.lang.Object key)
get in interface java.util.Map<java.lang.Integer,java.lang.Integer>public java.lang.Integer put(java.lang.Integer key,
java.lang.Integer value)
put in interface java.util.Map<java.lang.Integer,java.lang.Integer>public void forEach(java.util.function.BiConsumer<? super java.lang.Integer,? super java.lang.Integer> action)
forEach in interface java.util.Map<java.lang.Integer,java.lang.Integer>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Integer,java.lang.Integer>public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Integer,java.lang.Integer>public void putAll(java.util.Map<? extends java.lang.Integer,? extends java.lang.Integer> map)
putAll in interface java.util.Map<java.lang.Integer,java.lang.Integer>public Int2IntHashMap.KeySet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Integer>public Int2IntHashMap.Values values()
values in interface java.util.Map<java.lang.Integer,java.lang.Integer>public java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Integer>> entrySet()
entrySet in interface java.util.Map<java.lang.Integer,java.lang.Integer>public java.lang.Integer remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,java.lang.Integer>public int remove(int key)
public int minValue()
missingValue()public int maxValue()
missingValue()public java.lang.String toString()
toString in class java.lang.Objectpublic int replace(int key,
int value)
Map.replace(Object, Object)key - key with which the specified value is associatedvalue - value to be associated with the specified keymissingValue() if there was no mapping for the key.public boolean replace(int key,
int oldValue,
int newValue)
Map.replace(Object, Object, Object)key - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified keytrue if the value was replacedCopyright © 2014 - 2016 Real Logic Ltd. All Rights Reserved.