|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mat.collect.HashMapIntObject<E>
public final class HashMapIntObject<E>
A map from int to Object. More efficient than a general map
Nested Class Summary | |
---|---|
static interface |
HashMapIntObject.Entry<E>
An entry from the map |
Constructor Summary | |
---|---|
HashMapIntObject()
Create a map of default size |
|
HashMapIntObject(int initialCapacity)
Create a map of given capacity |
Method Summary | ||
---|---|---|
void |
clear()
Remove all the existing mappings, leaving the capacity unchanged. |
|
boolean |
containsKey(int key)
find if key is present in map |
|
java.util.Iterator<HashMapIntObject.Entry<E>> |
entries()
Iterate over all the map entries |
|
E |
get(int key)
Retrieve the value corresponding to the key |
|
int[] |
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 |
|
IteratorInt |
keys()
Get a way of iterating over the keys |
|
E |
put(int key,
E value)
Add a mapping |
|
E |
remove(int 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 HashMapIntObject()
public HashMapIntObject(int initialCapacity)
initialCapacity
- - can grow beyond thisMethod Detail |
---|
public E put(int key, E value)
key
- the keyvalue
- the corresponding value
public E remove(int key)
key
- the key to remove
public boolean containsKey(int key)
key
- the key
public E get(int key)
key
- the key
public int[] 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 IteratorInt keys()
public java.util.Iterator<E> values()
public java.util.Iterator<HashMapIntObject.Entry<E>> entries()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |