|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.collections.ArrayMap<K,V>
public class ArrayMap<K,V>
A simple Map implementation, taking roughly the same strategy as ArrayList, resulting in a memory-efficient and (for small amounts of key-value pairs) fast implementation.
| Nested Class Summary | |
|---|---|
class |
ArrayMap.Entry
|
| Constructor Summary | |
|---|---|
ArrayMap()
Create a new ArrayMap with an initial capacity of 0. |
|
ArrayMap(int initialCapacity)
Create new ArrayMap with the specified initial capacity. |
|
ArrayMap(Map<? extends K,? extends V> map)
Create a new ArrayMap that contains the same mappings as the specified map. |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
|
boolean |
equals(Object object)
|
V |
get(Object key)
|
K |
getKey(int index)
Get the key at the specified index in the map. |
V |
getValue(int index)
Get the value at the specified index in the map. |
int |
hashCode()
|
boolean |
isEmpty()
|
Set<K> |
keySet()
|
V |
put(K key,
V value)
|
void |
putAll(Map<? extends K,? extends V> map)
|
V |
remove(Object key)
|
int |
size()
|
String |
toString()
|
Collection<V> |
values()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayMap()
public ArrayMap(int initialCapacity)
initialCapacity - the initial capacity of the internal arrayspublic ArrayMap(Map<? extends K,? extends V> map)
map - the map duplicate| Method Detail |
|---|
public void clear()
clear in interface Map<K,V>public boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K,V>public boolean equals(Object object)
equals in interface Map<K,V>equals in class Objectpublic V get(Object key)
get in interface Map<K,V>public int hashCode()
hashCode in interface Map<K,V>hashCode in class Objectpublic boolean isEmpty()
isEmpty in interface Map<K,V>public Set<K> keySet()
keySet in interface Map<K,V>
public V put(K key,
V value)
put in interface Map<K,V>public void putAll(Map<? extends K,? extends V> map)
putAll in interface Map<K,V>public V remove(Object key)
remove in interface Map<K,V>public int size()
size in interface Map<K,V>public Collection<V> values()
values in interface Map<K,V>public K getKey(int index)
index - the index
public V getValue(int index)
index - the index
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||