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