|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mat.collect.HashMapIntLong
public final class HashMapIntLong
A map from int to long. More efficient than a general map
Nested Class Summary | |
---|---|
static interface |
HashMapIntLong.Entry
An entry from the map |
Constructor Summary | |
---|---|
HashMapIntLong()
Create a map of default size |
|
HashMapIntLong(int initialCapacity)
Create a map of given size |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashMapIntLong()
public HashMapIntLong(int initialCapacity)
initialCapacity
- Method Detail |
---|
public boolean put(int key, long value)
key
- the keyvalue
- the corresponding value
public boolean remove(int key)
key
- the key to remove
public boolean containsKey(int key)
key
- the key
public long get(int key)
key
- the key
NosuchElementException
- 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |