public class IntIntMap extends java.lang.Object implements java.lang.Iterable<IntIntMap.Entry>
限定符和类型 | 类和说明 |
---|---|
static class |
IntIntMap.Entries |
static class |
IntIntMap.Entry |
static class |
IntIntMap.Keys |
static class |
IntIntMap.Values |
限定符和类型 | 字段和说明 |
---|---|
int |
size |
构造器和说明 |
---|
IntIntMap()
Creates a new map with an initial capacity of 51 and a load factor of 0.8.
|
IntIntMap(int initialCapacity)
Creates a new map with a load factor of 0.8.
|
IntIntMap(int initialCapacity,
float loadFactor)
Creates a new map with the specified initial capacity and load factor.
|
IntIntMap(IntIntMap 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(int 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.
|
IntIntMap.Entries |
entries()
Returns an iterator for the entries in the map.
|
boolean |
equals(java.lang.Object obj) |
int |
findKey(int value,
int notFound)
Returns the key for the specified value, or null if it is not in the map.
|
int |
get(int key,
int defaultValue) |
int |
getAndIncrement(int key,
int defaultValue,
int increment)
Returns the key's current value and increments the stored value.
|
int |
hashCode() |
java.util.Iterator<IntIntMap.Entry> |
iterator() |
IntIntMap.Keys |
keys()
Returns an iterator for the keys in the map.
|
void |
put(int key,
int value) |
void |
putAll(IntIntMap map) |
int |
remove(int 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() |
IntIntMap.Values |
values()
Returns an iterator for the values in the map.
|
public IntIntMap()
public IntIntMap(int initialCapacity)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public IntIntMap(int initialCapacity, float loadFactor)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public IntIntMap(IntIntMap map)
public void put(int key, int value)
public void putAll(IntIntMap map)
public int get(int key, int defaultValue)
defaultValue
- Returned if the key was not associated with a value.public int getAndIncrement(int key, int defaultValue, int increment)
public int remove(int key, int defaultValue)
public void shrink(int maximumCapacity)
public void clear(int maximumCapacity)
public void clear()
public boolean containsValue(int value)
public boolean containsKey(int key)
public int findKey(int value, int notFound)
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 java.util.Iterator<IntIntMap.Entry> iterator()
iterator
在接口中 java.lang.Iterable<IntIntMap.Entry>
public IntIntMap.Entries entries()
IntIntMap.Entries
constructor for nested or multithreaded iteration.public IntIntMap.Values values()
IntIntMap.Entries
constructor for nested or multithreaded iteration.public IntIntMap.Keys keys()
IntIntMap.Entries
constructor for nested or multithreaded iteration.