⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.map

Class HashedMap

java.lang.Object
|
+--org.apache.commons.collections.map.AbstractHashedMap
   |
   +--org.apache.commons.collections.map.HashedMap

All Implemented Interfaces:
Cloneable, IterableMap, Serializable


public class HashedMap
extends AbstractHashedMap
implements Serializable, Cloneable

A Map implementation that is a general purpose alternative to HashMap.

This implementation improves on the JDK1.4 HashMap by adding the org.apache.commons.collections.MapIterator MapIterator functionality and many methods for subclassing.

Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

HashedMap()

Constructs a new empty map with default size and load factor.

HashedMap(int initialCapacity)

Constructs a new, empty map with the specified initial capacity.

HashedMap(int initialCapacity, float loadFactor)

Constructs a new, empty map with the specified initial capacity and load factor.

HashedMap(Map map)

Constructor copying elements from another map.

Method Summary

Object

clone()

Clones the map without cloning the keys or values.

Constructor Details

HashedMap

public HashedMap()

Constructs a new empty map with default size and load factor.


HashedMap

public HashedMap(int initialCapacity, float loadFactor)

Constructs a new, empty map with the specified initial capacity and load factor.

Parameters:
initialCapacity - the initial capacity
loadFactor - the load factor
Throws:
- if the initial capacity is less than one
- if the load factor is less than zero

HashedMap

public HashedMap(int initialCapacity)

Constructs a new, empty map with the specified initial capacity.

Parameters:
initialCapacity - the initial capacity
Throws:
- if the initial capacity is less than one

HashedMap

public HashedMap(Map map)

Constructor copying elements from another map.

Parameters:
map - the map to copy
Throws:
- if the map is null

Method Details

clone

public Object clone()

Clones the map without cloning the keys or values.

Returns:
a shallow clone