public class ObjectIntMap<K> extends java.lang.Object implements java.lang.Iterable<ObjectIntMap.Entry<K>>
限定符和类型 | 类和说明 |
---|---|
static class |
ObjectIntMap.Entries<K> |
static class |
ObjectIntMap.Entry<K> |
static class |
ObjectIntMap.Keys<K> |
static class |
ObjectIntMap.Values |
限定符和类型 | 字段和说明 |
---|---|
int |
size |
构造器和说明 |
---|
ObjectIntMap()
Creates a new map with an initial capacity of 51 and a load factor of 0.8.
|
ObjectIntMap(int initialCapacity)
Creates a new map with a load factor of 0.8.
|
ObjectIntMap(int initialCapacity,
float loadFactor)
Creates a new map with the specified initial capacity and load factor.
|
ObjectIntMap(ObjectIntMap<? extends K> map)
Creates a new map identical to the specified map.
|
限定符和类型 | 方法和说明 |
---|---|
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 accommodate the specified number of additional items.
|
ObjectIntMap.Entries<K> |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(java.lang.Object obj) |
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.
|
int |
hashCode() |
ObjectIntMap.Entries<K> |
iterator() |
ObjectIntMap.Keys<K> |
keys()
Returns an iterator for the keys in the map.
|
void |
put(K key,
int value) |
void |
putAll(ObjectIntMap<K> map) |
int |
remove(K key,
int defaultValue) |
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
java.lang.String |
toString() |
ObjectIntMap.Values |
values()
Returns an iterator for the values in the map.
|
public ObjectIntMap()
public ObjectIntMap(int initialCapacity)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public ObjectIntMap(int initialCapacity, float loadFactor)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public ObjectIntMap(ObjectIntMap<? extends K> map)
public void put(K key, int value)
public void putAll(ObjectIntMap<K> map)
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)
public int hashCode()
hashCode
在类中 java.lang.Object
public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
public java.lang.String toString()
toString
在类中 java.lang.Object
public ObjectIntMap.Entries<K> iterator()
iterator
在接口中 java.lang.Iterable<ObjectIntMap.Entry<K>>
public ObjectIntMap.Entries<K> entries()
ObjectIntMap.Entries
constructor for nested or multithreaded iteration.public ObjectIntMap.Values values()
ObjectIntMap.Entries
constructor for nested or multithreaded iteration.public ObjectIntMap.Keys<K> keys()
ObjectIntMap.Entries
constructor for nested or multithreaded iteration.