Parsing Engine

danbikel.util
Class HashMapTwoInts<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.HashMapInt<K>
                  extended by danbikel.util.HashMapTwoInts<K>
All Implemented Interfaces:
FlexibleMap<K,Object>, MapToPrimitive<K>, Serializable, Cloneable, Map<K,Object>

public class HashMapTwoInts<K>
extends HashMapInt<K>

A map for storing arbitrary Object instances as keys with ordered pairs of ints as values.

See Also:
Serialized Form

Nested Class Summary
protected static class HashMapTwoInts.Entry<K>
          A map entry for this type of map, containing a key and a pair of ints.
 
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
HashMapTwoInts()
          Constructs a new, empty map with a default capacity and load factor.
HashMapTwoInts(int initialCapacity)
          Constructs a new, empty map with the specified initial capacity and default load factor.
HashMapTwoInts(int initialCapacity, float loadFactor)
          Constructs a new, empty map with the specified initial capacity and the specified load factor.
HashMapTwoInts(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 pair of ints.
 
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

HashMapTwoInts

public HashMapTwoInts(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.

HashMapTwoInts

public HashMapTwoInts(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.

HashMapTwoInts

public HashMapTwoInts()
Constructs a new, empty map with a default capacity and load factor.


HashMapTwoInts

public HashMapTwoInts(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 initial capacity (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 pair of ints.

Overrides:
getNewEntry in class HashMapInt<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.