|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsli.util.collections.MapList
public class MapList
Implements a both a key-value map and a ordered list of key-value pairs. Ensures correspondence between the two structures.
| Constructor Summary | |
|---|---|
MapList()
|
|
MapList(List keys,
Map kvpairs,
boolean ensureEqual)
Makes a mapList from a list of keys and a map of key-value pairs. |
|
| Method Summary | |
|---|---|
void |
add(Object key,
Object value)
|
void |
add(Object key,
Object value,
int index)
Puts the key-value pair into the map, an inserts it into the list at the specified position. |
Object |
get(int index)
Returns the value at the specified position. |
Object |
get(Object key)
Returns the value associated with the key, null if none. |
Object |
getKey(int index)
Returns the value at the specified position. |
List |
getKeyList()
|
Map |
getMap()
|
List |
getValueList()
|
boolean |
put(Object key,
Object value)
Puts the key-value pair into the map. |
Object |
remove(int index)
Removes the key and value at index from the list, and the pair from the map. |
Object |
remove(Object key)
Removes the key and the associated value from both the map and the lists. |
Object |
set(int index,
Object value)
Sets the value at the specified position, and changes the assignment in that value in the map as well. |
int |
size()
Number of elements in the collection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapList(List keys,
Map kvpairs,
boolean ensureEqual)
public MapList()
| Method Detail |
|---|
public List getKeyList()
public List getValueList()
public Map getMap()
public void add(Object key,
Object value,
int index)
IllegalStateException - if the key is already in the map
public void add(Object key,
Object value)
public boolean put(Object key,
Object value)
public Object set(int index,
Object value)
public Object remove(Object key)
public Object remove(int index)
public Object getKey(int index)
public Object get(int index)
public Object get(Object key)
public int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||