|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weiss.util.MapImpl | +--weiss.util.HashMap
Hash table implementation of the Map.
Inner classes inherited from class weiss.util.Map |
Map.Entry |
Constructor Summary | |
HashMap()
Construct an empty HashMap. |
|
HashMap(Map other)
Construct a HashMap with same key/value pairs as another map. |
Method Summary | |
void |
clear()
Removes all key value pairs from the map. |
protected Set |
clonePairSet(Set pairSet)
|
boolean |
containsKey(java.lang.Object key)
Tests if this map contains a given key. |
Set |
entrySet()
Return a set of Map.Entry objects corresponding to the key/value pairs in the map. |
java.lang.Object |
get(java.lang.Object key)
Returns the value in the map associated with the key. |
protected Set |
getSet()
Return a reference to the underlying set. |
boolean |
isEmpty()
Tests if this map is empty. |
Set |
keySet()
Returns the keys in the map. |
protected Set |
makeEmptyKeySet()
|
protected Map.Entry |
makePair(java.lang.Object key,
java.lang.Object value)
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Adds the key value pair to the map, overriding the original value if the key was already present. |
java.lang.Object |
remove(java.lang.Object key)
Remove the key and its value from the map. |
int |
size()
Returns the number of keys in this map. |
Collection |
values()
Returns the values in the map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HashMap()
public HashMap(Map other)
other
- the other map.Method Detail |
protected Map.Entry makePair(java.lang.Object key, java.lang.Object value)
makePair
in class weiss.util.MapImpl
protected Set makeEmptyKeySet()
makeEmptyKeySet
in class weiss.util.MapImpl
protected Set clonePairSet(Set pairSet)
clonePairSet
in class weiss.util.MapImpl
public int size()
size
in interface Map
public boolean isEmpty()
isEmpty
in interface Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface Map
key
- the key to search for.public java.lang.Object get(java.lang.Object key)
get
in interface Map
key
- the key to search for.public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface Map
key
- the key to insert.value
- the value to insert.public java.lang.Object remove(java.lang.Object key)
remove
in interface Map
key
- the key to remove.public void clear()
clear
in interface Map
public Set keySet()
keySet
in interface Map
public Collection values()
values
in interface Map
public Set entrySet()
entrySet
in interface Map
protected Set getSet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |