org.exolab.adaptx.util
public class HashMap extends Object
Version: $Revision: 3633 $ $Date: 2003-03-01 02:38:44 -0500 (Sat, 01 Mar 2003) $
| Field Summary | |
|---|---|
| static int | DEFAULT_SIZE
The default number of buckets in this Map
|
| Constructor Summary | |
|---|---|
| HashMap()
Creates a new HashMap with the default number of buckets
| |
| HashMap(int size)
Creates a new HashMap with the given number of buckets. | |
| Method Summary | |
|---|---|
| void | clear()
Removes all entries from this Map
|
| boolean | containsKey(Object key)
Returns true if the given object is a key contained in this Map |
| boolean | containsValue(Object value)
Returns true if the given object is a value contained in this Map
Note: Depending on the size of the Map, this could be a slow operation. |
| Iterator | entries()
Returns an interator for the entries of this Map.
|
| boolean | equals(Object object)
Returns true if the given Object is a HashMap which contains
equivalent HashMap entries as this HashMap. |
| Object | get(Object key)
Returns the value associated with the given key |
| int | hashCode()
Returns the hashCode for this Map. |
| boolean | isEmpty()
Returns true if this map contains no entries |
| Iterator | keys() |
| void | put(Object key, Object value)
Associated the specified value with the given key in this Map |
| Object | remove(Object key)
Removes the association with the given Key in the Map. |
| int | size()
Returns the number of associations in the Map |
Parameters: size, the number of buckets to use, this value must
be a non-zero positive integer, if not the default size will
be used.
Note:The number of buckets is not the same as the
allocating space for a desired number of entries. If fact,
if you know number of entries that will be in the hash, you
might want to use a HashMap with a different implementation.
This Map is implemented using separate chaining.
Returns: true if the given object is a key contained in this Map
Returns: true if the given object is a value contained in this Map
Returns: an Iterator for the entries of this Map.
Returns: true if the given Object is a HashMap, and is equivalent
to this Map
I will be probably make an interface for Map, to allow comparisons
with different Map implemenations.
Returns: the value associated with the given key
Returns: true if this map contains no entries
Parameters: key the object to associate with the given value value the object to add an association in this Map
Parameters: key the object key to remove the association for
Returns: the associated value being removed from this Map
Returns: the number of associations in the Map