Parsing Engine

danbikel.util
Class HashMapDouble<K>

java.lang.Object
  extended by java.util.AbstractMap<K,Object>
      extended by danbikel.util.AbstractMapToPrimitive<K>
          extended by danbikel.util.HashMapPrimitive<K>
              extended by 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.
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
 
Fields inherited from class danbikel.util.HashMapPrimitive
defaultInitialCapacity, defaultLoadFactor, hashCodeBitmask, maxCapacity
 
Constructor Summary
HashMapDouble()
          Constructs a new, empty map with a default capacity and load factor.
HashMapDouble(int initialCapacity)
          Constructs a new, empty map with the specified initial capacity and default load factor.
HashMapDouble(int initialCapacity, float loadFactor)
          Constructs a new, empty map with the specified initial capacity and the specified load factor.
HashMapDouble(Map t)
          Constructs a new map with the same mappings as the given map.
 
Method Summary
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.
 
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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, size, values
 

Constructor Detail

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.
Method Detail

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 key
key - the key for this map entry to wrap
next - the next pointer for this entry in its singly-linked list (can be null)
Returns:
a new HashMapPrimitive.Entry for this type of map

Parsing Engine

Author: Dan Bikel.