public class IdentityObjectIntMap<K> extends 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() |
void |
clear(int maximumCapacity)
Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger.
|
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) |
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
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 shrink(int maximumCapacity)
public void clear(int maximumCapacity)
public void clear()
public boolean containsValue(int value)
public boolean containsKey(K key)
public K findKey(int value)
public void ensureCapacity(int additionalCapacity)
Copyright © 2018. All rights reserved.