public final class HashMapIntLong extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
HashMapIntLong.Entry
An entry from the map
|
Constructor and Description |
---|
HashMapIntLong()
Create a map of default size
|
HashMapIntLong(int initialCapacity)
Create a map of given size
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all the existing mappings,
leaving the capacity unchanged.
|
boolean |
containsKey(int key)
find if key is present in map
|
Iterator<HashMapIntLong.Entry> |
entries()
Iterate over all the map entries
|
long |
get(int key)
Retrieve the value corresponding to the key
|
int[] |
getAllKeys()
Get all the used keys
|
long[] |
getAllValues()
Get all the values corresponding to the used keys.
|
boolean |
isEmpty()
Is the map empty
|
IteratorInt |
keys()
Get a way of iterating over the keys
|
boolean |
put(int key,
long value)
Add a mapping
|
boolean |
remove(int key)
Remove an mapping from the map
|
int |
size()
The number of mappings
|
IteratorLong |
values()
Get a way of iterating over the values.
|
public HashMapIntLong()
public HashMapIntLong(int initialCapacity)
initialCapacity
- public boolean put(int key, long value)
key
- the keyvalue
- the corresponding valuepublic boolean remove(int key)
key
- the key to removepublic boolean containsKey(int key)
key
- the keypublic long get(int key)
key
- the keyNosuchElementException
- if the key is not foundpublic int[] getAllKeys()
public int size()
public boolean isEmpty()
public void clear()
public IteratorInt keys()
public IteratorLong values()
public Iterator<HashMapIntLong.Entry> entries()
public long[] getAllValues()