org.ws4d.java.structures
Class HashMap
java.lang.Object
org.ws4d.java.structures.HashMap
- Direct Known Subclasses:
- LinkedMap, LockedMap
public class HashMap
- extends java.lang.Object
Class implements a map of keys associated with values. The speed of the hash
map is linked to the quality of the hashCode() method of the key objects.
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
HashMap
public HashMap(int initialCapacity)
HashMap
public HashMap()
HashMap
public HashMap(HashMap map)
clear
public void clear()
containsKey
public boolean containsKey(java.lang.Object obj)
containsValue
public boolean containsValue(java.lang.Object obj)
get
public java.lang.Object get(java.lang.Object key)
- Get associated value to given key. A key ==
null
will always
return null
;
- Parameters:
key
- the key to lookup
- Returns:
- the value for the given key or
null
isEmpty
public boolean isEmpty()
put
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
putAll
public void putAll(HashMap map)
remove
public java.lang.Object remove(java.lang.Object key)
size
public int size()
entrySet
public Set entrySet()
keySet
public Set keySet()
values
public DataStructure values()
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object