Map implementation that is a general purpose alternative
to HashMap.
This implementation improves on the JDK1.4 HashMap by adding the
MapIterator
functionality and many methods for subclassing.
Note that HashedMap is not synchronized and is not thread-safe.
If you wish to use this map from multiple threads concurrently, you must use
appropriate synchronization. The simplest approach is to wrap this map
using java.. This class may throw
exceptions when accessed by concurrent threads without synchronization.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Serialisation version |
| Access | Constructor and Description |
|---|---|
| public | |
| public | HashedMap(final int
the initial capacity initialCapacity)Constructs a new, empty map with the specified initial capacity. |
| public | HashedMap(final int
the initial capacity initialCapacity, final float the load factor loadFactor)Constructs a new, empty map with the specified initial capacity and load factor. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HashedMap | Returns: a shallow cloneOverrides org. |
| private void | |
| private void |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialisation version | |
| HashedMap | back to summary |
|---|---|
| public HashedMap() Constructs a new empty map with default size and load factor. | |
| HashedMap | back to summary |
|---|---|
| public HashedMap(final int initialCapacity) Constructs a new, empty map with the specified initial capacity.
| |
| HashedMap | back to summary |
|---|---|
| public HashedMap(final int initialCapacity, final float loadFactor) Constructs a new, empty map with the specified initial capacity and load factor.
| |
| HashedMap | back to summary |
|---|---|
| public HashedMap(final Map<? extends K, ? extends V> map) Constructor copying elements from another map.
| |
| clone | back to summary |
|---|---|
| public HashedMap Overrides org. Clones the map without cloning the keys or values. | |
| readObject | back to summary |
|---|---|
| private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException Read the map in using a custom routine.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(final ObjectOutputStream out) throws IOException Write the map out using a custom routine.
| |