|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
org.slim3.commons.util.ArrayMap<K,V>
K - the key typeV - the value typepublic class ArrayMap<K,V>
A map acts like array.
| Field Summary | |
|---|---|
protected Set<Map.Entry<K,V>> |
entrySet
The set of entries. |
protected static int |
INITIAL_CAPACITY
The default initial capacity. |
protected org.slim3.commons.util.ArrayMap.Entry<K,V>[] |
listTable
The list table. |
protected static float |
LOAD_FACTOR
The default load factor. |
protected org.slim3.commons.util.ArrayMap.Entry<K,V>[] |
mapTable
The map table. |
protected int |
size
The number of entries. |
protected int |
threshold
The threshold to extend the capacity. |
| Constructor Summary | |
|---|---|
ArrayMap()
Constructor. |
|
ArrayMap(int initialCapacity)
Constructor. |
|
ArrayMap(Map<? extends K,? extends V> map)
Constructor. |
|
| Method Summary | |
|---|---|
void |
clear()
|
Object |
clone()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set<Map.Entry<K,V>> |
entrySet()
|
boolean |
equals(Object o)
|
V |
get(int index)
Returns the value for the index. |
V |
get(Object key)
|
org.slim3.commons.util.ArrayMap.Entry<K,V> |
getEntry(int index)
Returns the entry for the index. |
K |
getKey(int index)
Returns the key for the index. |
int |
indexOf(Object value)
Returns the index in the list table. |
boolean |
isEmpty()
|
V |
put(K key,
V value)
|
void |
putAll(Map<? extends K,? extends V> map)
|
void |
readExternal(ObjectInput in)
|
V |
remove(int index)
Removes the entry for the index. |
V |
remove(Object key)
|
void |
set(int index,
V value)
Sets the value for the index. |
int |
size()
|
Object[] |
toArray()
Converts this object to an array. |
Object[] |
toArray(Object[] proto)
Converts this object to an array. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.util.AbstractMap |
|---|
hashCode, keySet, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
hashCode, keySet, values |
| Field Detail |
|---|
protected static final int INITIAL_CAPACITY
protected static final float LOAD_FACTOR
protected transient int threshold
protected transient org.slim3.commons.util.ArrayMap.Entry<K,V>[] mapTable
protected transient org.slim3.commons.util.ArrayMap.Entry<K,V>[] listTable
protected transient int size
protected transient Set<Map.Entry<K,V>> entrySet
| Constructor Detail |
|---|
public ArrayMap()
public ArrayMap(int initialCapacity)
initialCapacity - the initial capacitypublic ArrayMap(Map<? extends K,? extends V> map)
map - other map| Method Detail |
|---|
public final int size()
size in interface Map<K,V>size in class AbstractMap<K,V>public final boolean isEmpty()
isEmpty in interface Map<K,V>isEmpty in class AbstractMap<K,V>public final boolean containsValue(Object value)
containsValue in interface Map<K,V>containsValue in class AbstractMap<K,V>public final int indexOf(Object value)
value - the value
public boolean containsKey(Object key)
containsKey in interface Map<K,V>containsKey in class AbstractMap<K,V>public V get(Object key)
get in interface Map<K,V>get in class AbstractMap<K,V>public final V get(int index)
index - the index
public final K getKey(int index)
index - the index
public final org.slim3.commons.util.ArrayMap.Entry<K,V> getEntry(int index)
index - the index
public V put(K key,
V value)
put in interface Map<K,V>put in class AbstractMap<K,V>
public final void set(int index,
V value)
index - the indexvalue - the valuepublic V remove(Object key)
remove in interface Map<K,V>remove in class AbstractMap<K,V>public final V remove(int index)
index - the index
public void putAll(Map<? extends K,? extends V> map)
putAll in interface Map<K,V>putAll in class AbstractMap<K,V>public final void clear()
clear in interface Map<K,V>clear in class AbstractMap<K,V>public final Object[] toArray()
public final Object[] toArray(Object[] proto)
proto - the prototype
public final boolean equals(Object o)
equals in interface Map<K,V>equals in class AbstractMap<K,V>public final Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K,V>entrySet in class AbstractMap<K,V>
public final void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
public final void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundExceptionpublic Object clone()
clone in class AbstractMap<K,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||