public class IntHashMap
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
IntHashMap()
Initializes a map with a capacity of 8 and a load factor of 0,25.
|
IntHashMap(int capacity)
Initializes a map with the given capacity and a load factor of 0,25.
|
IntHashMap(int capacity,
double factor)
Constructs a new map with initial capacity, and load factor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the map.
|
IntHashMap |
copy()
Create a copy of the IntHashMap
|
void |
display()
Diagnostic display of contents
|
java.lang.Object |
get(int key)
Gets the value for this key.
|
IntIterator |
keyIterator()
Get an iterator over the keys
|
java.lang.Object |
put(int key,
java.lang.Object value)
Adds a key-value pair to the map.
|
boolean |
remove(int key)
Removes a key from the map.
|
int |
size()
Gets the size of the map.
|
java.util.Iterator |
valueIterator()
Get an iterator over the values
|
public IntHashMap()
public IntHashMap(int capacity)
capacity
- the initial capacity.public IntHashMap(int capacity, double factor)
capacity
- the initial capacity.factor
- the load factor.public void clear()
public java.lang.Object get(int key)
key
- Keypublic int size()
public boolean remove(int key)
key
- Key to removepublic java.lang.Object put(int key, java.lang.Object value)
key
- Keyvalue
- Valuepublic IntIterator keyIterator()
public java.util.Iterator valueIterator()
public IntHashMap copy()
public void display()