|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mat.collect.HashMapObjectLong<E>
public final class HashMapObjectLong<E>
A map from Object to long. More efficient than a general map null not allowed as key.
Nested Class Summary | |
---|---|
static interface |
HashMapObjectLong.Entry<E>
An entry from the map |
Constructor Summary | |
---|---|
HashMapObjectLong()
Create a map of default size |
|
HashMapObjectLong(int initialCapacity)
Create a map of given size |
Method Summary | ||
---|---|---|
void |
clear()
Remove all the existing mappings, leaving the capacity unchanged. |
|
boolean |
containsKey(E key)
find if key is present in map |
|
java.util.Iterator<HashMapObjectLong.Entry<E>> |
entries()
Iterate over all the map entries |
|
long |
get(E key)
Retrieve the value corresponding to the key |
|
java.lang.Object[] |
getAllKeys()
Get all the used keys. |
|
|
getAllKeys(T[] a)
Get all the used keys. |
|
long[] |
getAllValues()
Get all the values corresponding to the used keys. |
|
boolean |
isEmpty()
Is the map empty |
|
java.util.Iterator<E> |
keys()
Get a way of iterating over the keys |
|
boolean |
put(E key,
long value)
Add a mapping |
|
boolean |
remove(E 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 HashMapObjectLong()
public HashMapObjectLong(int initialCapacity)
initialCapacity
- Method Detail |
---|
public boolean put(E key, long value)
key
- the keyvalue
- the corresponding value
public boolean remove(E key)
key
- the key to remove
public boolean containsKey(E key)
key
- the key
public long get(E key)
key
- the key
NosuchElementException
- if the key is not foundpublic java.lang.Object[] getAllKeys()
getAllKeys(Object[])
for better type safety
public <T> T[] getAllKeys(T[] a)
public int size()
public boolean isEmpty()
public void clear()
public java.util.Iterator<E> keys()
public IteratorLong values()
public java.util.Iterator<HashMapObjectLong.Entry<E>> entries()
public long[] getAllValues()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |