public class IdentityObjectIntMap<K>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
size |
Constructor and Description |
---|
IdentityObjectIntMap()
Creates a new map with an initial capacity of 32 and a load factor of 0.8.
|
IdentityObjectIntMap(int initialCapacity)
Creates a new map with a load factor of 0.8.
|
IdentityObjectIntMap(int initialCapacity,
float loadFactor)
Creates a new map with the specified initial capacity and load factor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(K key) |
boolean |
containsValue(int value)
Returns true if the specified value is in the map.
|
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to acommodate the specified number of additional items.
|
K |
findKey(int value)
Returns the key for the specified value, or null if it is not in the map.
|
int |
get(K key,
int defaultValue) |
int |
getAndIncrement(K key,
int defaultValue,
int increment)
Returns the key's current value and increments the stored value.
|
void |
put(K key,
int value) |
int |
remove(K key,
int defaultValue) |
java.lang.String |
toString() |
public IdentityObjectIntMap()
public IdentityObjectIntMap(int initialCapacity)
public IdentityObjectIntMap(int initialCapacity, float loadFactor)
public void put(K key, int value)
public int get(K key, int defaultValue)
defaultValue
- Returned if the key was not associated with a value.public int getAndIncrement(K key, int defaultValue, int increment)
public int remove(K key, int defaultValue)
public void clear()
public boolean containsValue(int value)
public boolean containsKey(K key)
public K findKey(int value)
public void ensureCapacity(int additionalCapacity)
public java.lang.String toString()
toString
in class java.lang.Object