Class HashMap
java.lang.Object
|
+----HashMap
- public class HashMap
- extends Object
Simple implementation of a map (key-value pair).
This class just a wrapper on HashTable until the new
JDK 1.2 HashMap interface becomes available.
- Version:
- 0.1
- Author:
- Jörg Caumanns
-
HashMap()
- constructor
-
get(Object)
- Retrieve an object from the map.
-
put(Object, Object)
- Add an object to the map.
-
remove(Object)
- Remove an key from the set.
HashMap
public HashMap()
- constructor
put
public synchronized Object put(Object key,
Object value)
- Add an object to the map. If the object with the given key
already exists within the map it is overwritten. If the
object was newly added, nul is returned otherwise the old
value associated with the given key.
get
public synchronized Object get(Object key)
- Retrieve an object from the map.
remove
public synchronized Object remove(Object key)
- Remove an key from the set. If the key could be removed
the appropriate object is returned, otherwise null.