|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdsto.dfc.collections.MicroMap
public class MicroMap
A small footprint Map-like collection that provides basic put/get/remove functionality for small maps that don't change much. Lookup cost and memory usage scales linearly with entry count.
| Constructor Summary | |
|---|---|
MicroMap()
Create a map with a default initial capacity before resize. |
|
MicroMap(int initialCapacity)
Create a map with a given initial capacity before resize. |
|
| Method Summary | |
|---|---|
void |
clear()
Remove all entries. |
boolean |
containsKey(Object key)
Test if the map contains a key. |
int |
findIndex(Object key)
Find the index for a key, or -1 if not found. |
Object |
get(Object key)
Find the value with matchinf key. |
Object |
getKey(int index)
Get the key for an index (0..size ()). |
Object |
getValue(int index)
Get the value for an index (0..size ()). |
Object |
put(Object key,
Object value)
Add/overwrite a value. |
Object |
remove(Object key)
Remove a value. |
int |
size()
The number of entries in the map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MicroMap()
public MicroMap(int initialCapacity)
| Method Detail |
|---|
public void clear()
public Object put(Object key,
Object value)
key - The value key.value - The value.
public Object remove(Object key)
key - The value key.
public Object get(Object key)
key - The key to search for.
public boolean containsKey(Object key)
public int size()
public Object getKey(int index)
public Object getValue(int index)
public int findIndex(Object key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||