|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--uwcse.collections.SimpleListMap
Implementation of the SimpleMap interface via a single SimpleList. A simple, but not efficient implementation. The fundamental operations (get, put, remove) all execute in O(N) time, where N is the number of entries in the table.
| Constructor Summary | |
SimpleListMap()
|
|
| Method Summary | |
void |
clear()
Remove all associations from the map. |
boolean |
containsKey(java.lang.Object key)
Answer true iff the given key exists in the map. |
boolean |
containsValue(java.lang.Object value)
Answer true iff the given value exists in the map. |
java.lang.Object |
get(java.lang.Object key)
Answer the value associated with the given key. |
boolean |
isEmpty()
Answer (size() == 0) |
SimpleIterator |
keys()
Answer a SimpleIterator over the keys in the association. |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associate the given key and value, replacing any previous association for the given key. |
java.lang.Object |
remove(java.lang.Object key)
Remove the association (if any) for the given key. |
int |
size()
Answer the number of associations in the map. |
java.lang.String |
toString()
|
SimpleIterator |
values()
Answer a SimpleIterator over the values in the association. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SimpleListMap()
| Method Detail |
public void clear()
SimpleMapclear in interface SimpleMappublic boolean containsKey(java.lang.Object key)
SimpleMapcontainsKey in interface SimpleMappublic boolean containsValue(java.lang.Object value)
SimpleMapcontainsValue in interface SimpleMappublic java.lang.Object get(java.lang.Object key)
SimpleMapget in interface SimpleMapuwcse.collections.SimpleMappublic boolean isEmpty()
SimpleMapisEmpty in interface SimpleMappublic SimpleIterator keys()
SimpleMapkeys in interface SimpleMappublic static void main(java.lang.String[] args)
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
SimpleMapput in interface SimpleMapuwcse.collections.SimpleMappublic java.lang.Object remove(java.lang.Object key)
SimpleMapremove in interface SimpleMapuwcse.collections.SimpleMappublic int size()
SimpleMapsize in interface SimpleMappublic java.lang.String toString()
toString in class java.lang.Objectpublic SimpleIterator values()
SimpleMapvalues in interface SimpleMap
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||