danbikel.util
Class HashMapDouble<K>
java.lang.Object
java.util.AbstractMap<K,Object>
danbikel.util.AbstractMapToPrimitive<K>
danbikel.util.HashMapPrimitive<K>
danbikel.util.HashMapDouble<K>
- All Implemented Interfaces:
- FlexibleMap<K,Object>, MapToPrimitive<K>, Serializable, Cloneable, Map<K,Object>
- Direct Known Subclasses:
- CountsTableImpl, HashMapTwoDoubles, ProbabilityCache
public class HashMapDouble<K>
- extends HashMapPrimitive<K>
- implements Cloneable, Serializable
A map from arbitrary keys to double
values.
- See Also:
- Serialized Form
Nested Class Summary |
protected static class |
HashMapDouble.Entry<K>
A map entry for this type of map, containing a key and a
double . |
Methods inherited from class danbikel.util.HashMapPrimitive |
add, add, add, add, add, add, addEntryMRU, containsKey, entrySet, get, getCapacity, getEntry, getEntry, getEntryMRU, getEntryMRU, getLoadFactor, getOrCreateEntry, getStats, put, put, put, put, put, put, put, put, remove, removeLRU, removeLRU, removeRandom |
Methods inherited from class danbikel.util.AbstractMapToPrimitive |
add, add, add, add, add, add, put, put, put, put, put, put, put, removeRandom, toString |
Methods inherited from class java.util.AbstractMap |
clear, clone, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, size, values |
HashMapDouble
public HashMapDouble(int initialCapacity,
float loadFactor)
- Constructs a new, empty map with the specified initial capacity and the
specified load factor.
- Parameters:
initialCapacity
- the initial capacity of the HashMap.loadFactor
- the load factor of the HashMap
- Throws:
IllegalArgumentException
- if the initial capacity is less than zero,
or if the load factor is nonpositive.
HashMapDouble
public HashMapDouble(int initialCapacity)
- Constructs a new, empty map with the specified initial capacity and
default load factor
.
- Parameters:
initialCapacity
- the initial capacity of the HashMap.
- Throws:
IllegalArgumentException
- if the initial capacity is less than
zero.
HashMapDouble
public HashMapDouble()
- Constructs a new, empty map with a
default capacity
and
load factor
.
HashMapDouble
public HashMapDouble(Map t)
- Constructs a new map with the same mappings as the given map. The map is
created with a capacity of twice the number of mappings in the given map or
the default size
(whichever
is greater), and a default load
factor
.
- Parameters:
t
- the map whose mappings are to be placed in this map.
getNewEntry
protected HashMapPrimitive.Entry<K> getNewEntry(int hash,
K key,
HashMapPrimitive.Entry<K> next)
- Gets a map entry for this type of map, containing a key and a
double
.
- Specified by:
getNewEntry
in class HashMapPrimitive<K>
- Parameters:
hash
- the hash value of the specified keykey
- the key for this map entry to wrapnext
- the next pointer for this entry in its singly-linked list (can
be null)
- Returns:
- a new
HashMapPrimitive.Entry
for this type of map
Author: Dan Bikel.